database - NullPointerException in android project -
i tried launch addeditrecipesactivity.java recipesactivity.java. in recipesactivity there list of data datatable. pressing add button in recipesactivity, addeditrecipesactivity.java called, insert data in datatable. when pressed button, application crashed.
this logcat messages.
08-20 04:13:20.315: e/your tag,(9425): message - 08-20 04:13:20.315: e/your tag,(9425): java.lang.runtimeexception: unable instantiate activity componentinfo{com.example.behealthy/com.example.behealthy.addeditrecipesactivity}: java.lang.nullpointerexception - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.activitythread.performlaunchactivity(activitythread.java:2024) - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2125) - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.activitythread.access$600(activitythread.java:140) - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.activitythread$h.handlemessage(activitythread.java:1227) - 08-20 04:13:20.315: e/your tag,(9425): @ android.os.handler.dispatchmessage(handler.java:99) - 08-20 04:13:20.315: e/your tag,(9425): @ android.os.looper.loop(looper.java:137) - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.activitythread.main(activitythread.java:4898) - 08-20 04:13:20.315: e/your tag,(9425): @ java.lang.reflect.method.invokenative(native method) - 08-20 04:13:20.315: e/your tag,(9425): @ java.lang.reflect.method.invoke(method.java:511) - 08-20 04:13:20.315: e/your tag,(9425): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1006) - 08-20 04:13:20.315: e/your tag,(9425): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:773) - 08-20 04:13:20.315: e/your tag,(9425): @ dalvik.system.nativestart.main(native method) - 08-20 04:13:20.315: e/your tag,(9425): caused by: java.lang.nullpointerexception - 08-20 04:13:20.315: e/your tag,(9425): @ android.content.contextwrapper.openorcreatedatabase(contextwrapper.java:228) - 08-20 04:13:20.315: e/your tag,(9425): @ android.database.sqlite.sqliteopenhelper.getdatabaselocked(sqliteopenhelper.java:224) - 08-20 04:13:20.315: e/your tag,(9425): @ android.database.sqlite.sqliteopenhelper.getwritabledatabase(sqliteopenhelper.java:164) - 08-20 04:13:20.315: e/your tag,(9425): @ com.example.behealthy.addeditrecipesactivity.<init>(addeditrecipesactivity.java:27) - 08-20 04:13:20.315: e/your tag,(9425): @ java.lang.class.newinstanceimpl(native method) - 08-20 04:13:20.315: e/your tag,(9425): @ java.lang.class.newinstance(class.java:1319) - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.instrumentation.newactivity(instrumentation.java:1057) - 08-20 04:13:20.315: e/your tag,(9425): @ android.app.activitythread.performlaunchactivity(activitythread.java:2015) - 08-20 04:13:20.315: e/your tag,(9425): ... 11 more
thanks.
from line
caused by: java.lang.nullpointerexception
we know problem null
. , line (the first line after references project)
at com.example.behealthy.addeditrecipesactivity.<init>(addeditrecipesactivity.java:27)
we know "something null" @ line 27 of addeditrecipesactivity
see null
there , figure out why null
. if need more please post relevant code.
Comments
Post a Comment