App stürzt ab nach klick auf Homebutton...

  • 7 Antworten
  • Letztes Antwortdatum
B

ben56a

Ambitioniertes Mitglied
0
Ich habe eine App entwickelt. Allerdings jetzt ein Problem festegestellt.
Wenn man mit dem Homebutton aus der App heraus geht und ca 10 Minuten wartet, dabei noch andere Dinge mit dem Smartphone macht, dann stürzt die app beim erneuten starten ab.

Es wird nur die ActionBar angezeigt und ein weißer Hintergrund. Die ListView wird nicht geladen.

Dieser Absturzt ist allerdings erst nach einer gewissen Zeit. Wenn man den Homebutton betätigt und dann direkt wieder in die App geht, dann funktioniert alles einwandfrei.

Hat jemand eine Idee, woran das liegt?
 
Poste Bitte nen logcat sofort nachdem die App crasht.

//tapatalked / i9100 / CMX
 
10-22 17:33:59.995: W/AlarmManager(2100): FACTORY_ON= 0
10-22 17:34:00.000: D/KeyguardUpdateMonitor(2100): handleTimeUpdate
10-22 17:34:00.015: D/STATUSBAR-Clock(2231): onReceive() - ACTION_TIME_TICK
10-22 17:34:00.020: D/STATUSBAR-Clock(2231): updateClock :17:34
10-22 17:34:00.045: D/STATUSBAR-DateView(2231): updateClock :22.10.2012
10-22 17:34:00.100: D/facerecognition(31068): FR_FileOpen /sdcard/.face/facedata=71
10-22 17:34:00.100: D/facerecognition(31068): FR_FileOpen /data/data/com.android.providers.media/face/facedata=72
10-22 17:34:00.110: D/MtpService(31068): addStorageLocked 65537 /mnt/sdcard
10-22 17:34:00.125: D/MtpService(31068): starting MTP server in MTP mode
10-22 17:34:00.135: E/MtpServerJNI(31068): could not open MTP driver, errno: 2
10-22 17:34:00.135: D/MtpService(31068): addStorageLocked 65537 /mnt/sdcard
10-22 17:34:00.135: E/MtpServerJNI(31068): server is null in add_storage
10-22 17:34:00.135: E/MtpServerJNI(31068): server is null in run
10-22 17:34:00.135: E/MtpServerJNI(31068): server is null in cleanup
10-22 17:34:00.150: D/STATUSBAR-NotificationService(2100): cancelAllNotifications()
10-22 17:34:00.230: D/dalvikvm(31068): GC_CONCURRENT freed 278K, 5% free 13884K/14535K, paused 7ms+4ms
10-22 17:34:00.350: W/ActivityManager(2100): Launch timeout has expired, giving up wake lock!
10-22 17:34:04.615: D/STATUSBAR-NetworkController(2231): onReceive() - RSSI_CHANGED_ACTION, WIFI_STATE, NETWORK_STATE
10-22 17:34:05.965: V/AlarmManager(2100): waitForAlarm result :2
10-22 17:34:06.000: I/ActivityManager(2100): Start proc app.processName for service hostingNameStr: pid=31086 uid=10161 gids={1006, 3003, 1015, 1023}
10-22 17:34:06.050: D/dalvikvm(1902): GC_EXPLICIT freed 38K, 5% free 13702K/14275K, paused 3ms+2ms
10-22 17:34:06.075: D/dalvikvm(1902): GC_EXPLICIT freed <1K, 5% free 13702K/14275K, paused 1ms+2ms
10-22 17:34:06.100: D/dalvikvm(1902): GC_EXPLICIT freed <1K, 5% free 13702K/14275K, paused 1ms+2ms
 
Hier der richtige STACKTRACE:

10-23 11:01:31.495: E/AndroidRuntime(12910): FATAL EXCEPTION: main
10-23 11:01:31.495: E/AndroidRuntime(12910): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.x.x/com.x.x.activity_x}: java.lang.NullPointerException
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.ActivityThread.access$600(ActivityThread.java:128)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.os.Handler.dispatchMessage(Handler.java:99)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.os.Looper.loop(Looper.java:137)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.ActivityThread.main(ActivityThread.java:4517)
10-23 11:01:31.495: E/AndroidRuntime(12910): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 11:01:31.495: E/AndroidRuntime(12910): at java.lang.reflect.Method.invoke(Method.java:511)
10-23 11:01:31.495: E/AndroidRuntime(12910): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
10-23 11:01:31.495: E/AndroidRuntime(12910): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
10-23 11:01:31.495: E/AndroidRuntime(12910): at dalvik.system.NativeStart.main(Native Method)
10-23 11:01:31.495: E/AndroidRuntime(12910): Caused by: java.lang.NullPointerException
10-23 11:01:31.495: E/AndroidRuntime(12910): at com.x.adapter.SimpleReceiptAdapter.<init>(SimpleReceiptAdapter.java:43)
10-23 11:01:31.495: E/AndroidRuntime(12910): at com.x.x.activity_x.onCreate(activity_x.java:105)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.Activity.performCreate(Activity.java:4533)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
10-23 11:01:31.495: E/AndroidRuntime(12910): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
10-23 11:01:31.495: E/AndroidRuntime(12910): ... 11 more


ben56a schrieb:
10-22 17:33:59.995: W/AlarmManager(2100): FACTORY_ON= 0
10-22 17:34:00.000: D/KeyguardUpdateMonitor(2100): handleTimeUpdate
10-22 17:34:00.015: D/STATUSBAR-Clock(2231): onReceive() - ACTION_TIME_TICK
10-22 17:34:00.020: D/STATUSBAR-Clock(2231): updateClock :17:34
10-22 17:34:00.045: D/STATUSBAR-DateView(2231): updateClock :22.10.2012
10-22 17:34:00.100: D/facerecognition(31068): FR_FileOpen /sdcard/.face/facedata=71
10-22 17:34:00.100: D/facerecognition(31068): FR_FileOpen /data/data/com.android.providers.media/face/facedata=72
10-22 17:34:00.110: D/MtpService(31068): addStorageLocked 65537 /mnt/sdcard
10-22 17:34:00.125: D/MtpService(31068): starting MTP server in MTP mode
10-22 17:34:00.135: E/MtpServerJNI(31068): could not open MTP driver, errno: 2
10-22 17:34:00.135: D/MtpService(31068): addStorageLocked 65537 /mnt/sdcard
10-22 17:34:00.135: E/MtpServerJNI(31068): server is null in add_storage
10-22 17:34:00.135: E/MtpServerJNI(31068): server is null in run
10-22 17:34:00.135: E/MtpServerJNI(31068): server is null in cleanup
10-22 17:34:00.150: D/STATUSBAR-NotificationService(2100): cancelAllNotifications()
10-22 17:34:00.230: D/dalvikvm(31068): GC_CONCURRENT freed 278K, 5% free 13884K/14535K, paused 7ms+4ms
10-22 17:34:00.350: W/ActivityManager(2100): Launch timeout has expired, giving up wake lock!
10-22 17:34:04.615: D/STATUSBAR-NetworkController(2231): onReceive() - RSSI_CHANGED_ACTION, WIFI_STATE, NETWORK_STATE
10-22 17:34:05.965: V/AlarmManager(2100): waitForAlarm result :2
10-22 17:34:06.000: I/ActivityManager(2100): Start proc app.processName for service hostingNameStr: pid=31086 uid=10161 gids={1006, 3003, 1015, 1023}
10-22 17:34:06.050: D/dalvikvm(1902): GC_EXPLICIT freed 38K, 5% free 13702K/14275K, paused 3ms+2ms
10-22 17:34:06.075: D/dalvikvm(1902): GC_EXPLICIT freed <1K, 5% free 13702K/14275K, paused 1ms+2ms
10-22 17:34:06.100: D/dalvikvm(1902): GC_EXPLICIT freed <1K, 5% free 13702K/14275K, paused 1ms+2ms
 
nullpointer in deinem simplereceiptadapter - zeile 43

da wird noch was ausgeführt und auf etwas zugegriffen, was nicht mehr da ist
halt abfragen bevor du drauf zugreifst
 
swordi schrieb:
nullpointer in deinem simplereceiptadapter - zeile 43

da wird noch was ausgeführt und auf etwas zugegriffen, was nicht mehr da ist
halt abfragen bevor du drauf zugreifst

Es handelt sich dabei um eine Liste von CarObjekten. Die Listeneinträge werden dann anhand der Attribute erzeugt.

Wenn die Liste null ist, dann wird beim restart aber leider auch die Liste leer sein. Das will ich aber nicht. Es wird doch die onCreate durchlaufen wenn man die app wieder öffnet oder?
 
wenn du mittels home aus der app aussteigst, wird das oncreate nicht zwangsweise wieder aufgerufen

=> siehe activity lifecycle

onResume wird aber sicher wieder aufgerufen
 
wie swordi schon sagte, befasse dich bitte mit den lifecycle

Activity | Android Developers

wenn du das durch hast, dan sollten die restlichen missverständnisse auch geklärt sein :)
 

Ähnliche Themen

G
Antworten
0
Aufrufe
148
Gerdchen07
G
G
Antworten
1
Aufrufe
393
Gerdchen07
G
G
Antworten
13
Aufrufe
621
Gerdchen07
G
L
Antworten
3
Aufrufe
660
mips400
mips400
migi01
Antworten
26
Aufrufe
2.040
migi01
migi01
Zurück
Oben Unten