This is the error I am getting:
Caused by: java.lang.IllegalArgumentException: Unknown URL content://com.new.newapp.locations/locations
at android.content.ContentResolver.insert(ContentResolver.java:1213)
at com.new.newapp.activity.FragmentGoogleMap$LocationInsertTask.doInBackground(FragmentGoogleMap.java:364)
at com.new.newapp.activity.FragmentGoogleMap$LocationInsertTask.doInBackground(FragmentGoogleMap.java:360)
And I have researched this problem and found these similar questions: Link1 Link2 Link3
And non of these helped. What bugs me a lot is that when I was using eclipse I didn't have this issue, but since working on Android Studio I can't seem to get this working.
in my LocationsContentProvider
class:
package com.new.newapp.activity;
public class LocationsContentProvider extends ContentProvider{
public static final String PROVIDER_NAME ="com.new.newapp.activtiy.locations";
public static final Uri CONTENT_URI = Uri.parse("content://" + PROVIDER_NAME + "/locations" );
private static final int LOCATIONS = 1;
private static final UriMatcher uriMatcher ;
static {
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
uriMatcher.addURI(PROVIDER_NAME, "locations", LOCATIONS);
}
LocationsDB mLocationsDB;
And in my manifest I have this:
</activity>
<provider
android:name="com.new.newapp.activity.LocationsContentProvider"
android:authorities="locations"
android:exported="false" />
</application>
I have tried android:authorities="com.new.newapp.activity.locations"
I have also tried android:name=".LocationsContentProvider"
Have also moved
Could some one please help?