URI Exception at insert query
I am trying to create a Co开发者_运维百科ntentProvider
and getting exception at insert query. I tried different google searches, couldn't fix it can you please tell me where I am messing up the URI, thanks.
The error is
java.lang.IllegalArgumentException:
Unknown URL content://com.ranj.ContenProvExample/phonebook
1) Here is my URI in Class ContenProvExample extends ContentProvider
:
public static final
Uri CONTENT_URI = Uri.parse("content://com.ranj.ContenProvExample/phonebook");
2) Here is my AndroidManifest:
<provider android:name=".ContenProvExample"
android:authorities="com.ranj.contenprovexample"
/>
3) Getting error at an Activity inside onCreate()
:
ContentResolver cnrslvr = getContentResolver();
cnrslvr.insert(ContenProvExample.Constants.CONTENT_URI, getValues());
精彩评论