Hi List,

I am trying Android SDK 3, API 11.  I was trying to learn Content
Provider with the example given in Samples.

While running ContactManager I am getting NullPointerException -

04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
com.sanoop.ContactAdder.createContactEntry(ContactAdder.java:170)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
com.sanoop.ContactAdder.onSaveButtonClicked(ContactAdder.java:146)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
com.sanoop.ContactAdder.access$1(ContactAdder.java:144)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
com.sanoop.ContactAdder$2.onClick(ContactAdder.java:135)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
android.view.View.performClick(View.java:3100)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at android.view.View
$PerformClick.run(View.java:11644)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
android.os.Handler.handleCallback(Handler.java:587)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
android.os.Handler.dispatchMessage(Handler.java:92)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
android.os.Looper.loop(Looper.java:126)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
android.app.ActivityThread.main(ActivityThread.java:3997)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
java.lang.reflect.Method.invokeNative(Native Method)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
java.lang.reflect.Method.invoke(Method.java:491)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-12 00:25:07.379: ERROR/AndroidRuntime(541):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)


Line number 170 code is -

ArrayList<ContentProviderOperation> ops = new
ArrayList<ContentProviderOperation>();
 
ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
                .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE,
mSelectedAccount.getType())
                .withValue(ContactsContract.RawContacts.ACCOUNT_NAME,
mSelectedAccount.getName()).build());



And all the code lines are simply copied from the samples
\android-11\ContactManager.



please help me out.


Thanks,
Sanoop

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to