display content provider's save item in list view but throwing exception "null pointer"
hi dear i have one text box and and two button in my lay out which text i have enter save it in content provider by pressing save button and other button is for display content provider's save item in list view by pressing "mContactSendButton" button but it is throwing null pointer exception when i click save button why pls modify in my code pls pls i think problem is clear to all of u..so pls take a throughly look at my code and do required modification in it please ..thanks in adv.
Handler.java:99)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at android.os.Looper.loop(Looper.java:123)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at java.lang.reflect.Method.invokeNative(Native Method)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at java.lang.reflect.Method.invoke(Method.java:507)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at com.android.internal.os.ZygoteInit.main(ZygoteI开发者_StackOverflow中文版nit.java:597)
06-09 17:32:05.033: ERROR/AndroidRuntime(1094): at dalvik.system.NativeStart.main(Native Method)
06-09 17:32:05.060: WARN/ActivityManager(71): Force finishing activity com.linkwithweb/.CustomProviderDemo
I am not sure which command is line 45: is it String name = mContactNameEditText.getText().toString();
or madapter.insertRecord(name);
?
But I guess its the second one, because madapter is never initialized and should be null at the moment of calling madapter.insertRecord(name);
.
精彩评论