Berlin-Vegan / berlin-vegan-guide

mobile app for android
GNU General Public License v2.0
13 stars 9 forks source link

Nullpointer GastroActivity#onPostCreate #19

Closed smeir closed 9 years ago

smeir commented 9 years ago

Acra-Report-ID: 06d108c4-8b56-4c5c-a013-cf7de16f2972

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.berlin_vegan.bvapp_alpha/org.berlin_vegan.bvapp.GastroActivity}: java.lang.NullPointerException
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2099)
    at android.app.ActivityThread.access$600(ActivityThread.java:145)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
    at android.os.Handler.dispatchMessage(Handler.java:119)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4873)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:528)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
    at org.berlin_vegan.bvapp.GastroActivity.onPostCreate(GastroActivity.java:47)
    at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1150)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2057)
    ... 11 more
java.lang.NullPointerException
    at org.berlin_vegan.bvapp.GastroActivity.onPostCreate(GastroActivity.java:47)
    at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1150)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2057)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2099)
    at android.app.ActivityThread.access$600(ActivityThread.java:145)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
    at android.os.Handler.dispatchMessage(Handler.java:119)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4873)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:528)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
IncorporateApps commented 9 years ago

Haben wir da input wie das passiert ist, rotate screen oder so was? Das Problem ist hier toolbar.setTitle(mGastroLocation.getName());

Anscheinend ist mGastroLocation null und es liegt wohl an: if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras != null) { mGastroLocation = (GastroLocation) extras.getSerializable(EXTRA_GASTRO_LOCATION); } } else { mGastroLocation = (GastroLocation) savedInstanceState.getSerializable(EXTRA_GASTRO_LOCATION); }

brauchen wir diese savedInstances? Wenn wir die configChanges im Manifest überschrieben haben, regelt Android das alles für uns.

IncorporateApps commented 9 years ago

hab mal mGastroLocation!=null onPostCreate gesetzt vielleicht mal nachforschen wie das Problem Zustande kommt?

IncorporateApps commented 9 years ago

Eventuell doch noch öffnen, um die Ursache zu erforschen.

On Jun 25, 2015, at 13:42 PM, jmastr notifications@github.com wrote:

Closed #19 via e64c21b.

— Reply to this email directly or view it on GitHub.

smeir commented 9 years ago

Ich habe zumindestens im Code ein Todo hinzugefügt. :-)