i new android development, code below:
animationlistener al = new animation.animationlistener(){ public void onanimationend(animation animation){ try{ intent mainmenu = new intent(splash.this,mainmenu.class); startactivity(mainmenu); log.d(splash.activity_tag, "haha , after startactivity."); } catch (exception e){ string str= e.getmessage(); log.d(splash.activity_tag, " in catch."); } } public void onanimationrepeat(animation animation){} public void onanimationstart(animation animation){} };
this part has no error, since didn't catch exception. cannot go next activity mainmenu. debug code through f8, , program stop @ threat, , throw uncaught exception. ` 06-05 22:32:31.191: e/trace(623): error opening trace file: no such file or directory (2)
06-05 22:32:31.381: w/activitythread(623): application com.example.zami waiting debugger on port 8100...
06-05 22:32:31.421: i/system.out(623): sending wait chunk
06-05 22:32:31.530: i/dalvikvm(623): debugger active
06-05 22:32:31.635: i/system.out(623): debugger has connected
06-05 22:32:31.635: i/system.out(623): waiting debugger settle...
06-05 22:32:31.840: i/system.out(623): waiting debugger settle...
06-05 22:32:33.650: i/system.out(623): debugger has settled (1406)
06-05 22:32:34.760: d/dalvikvm(623): gc_for_alloc freed 71k, 2% free 10847k/11011k, paused 45ms, total 53ms
06-05 22:32:34.780: i/dalvikvm-heap(623): grow heap (frag case) 11.873mb 1310512-byte allocation
06-05 22:32:34.840: d/dalvikvm(623): gc_concurrent freed 1k, 2% free 12125k/12295k, paused 16ms+5ms, total 49ms
06-05 22:32:34.960: d/dalvikvm(623): gc_for_alloc freed 0k, 2% free 12126k/12295k, paused 30ms, total 30ms
06-05 22:32:34.980: i/dalvikvm-heap(623): grow heap (frag case) 14.093mb 2330784-byte allocation
06-05 22:32:35.040: d/dalvikvm(623): gc_concurrent freed 0k, 2% free 14402k/14599k, paused 15ms+15ms, total 61ms
06-05 22:32:35.630: d/gralloc_goldfish(623): emulator without gpu emulation detected.
06-05 22:32:38.330: d/myandroid(623): haha , after startactivity.
06-05 22:33:45.141: d/androidruntime(623): shutting down vm
06-05 22:33:45.141: w/dalvikvm(623): threadid=1: thread exiting uncaught exception (group=0x40a13300)
06-05 22:33:47.050: e/androidruntime(623): fatal exception: main
06-05 22:33:47.050: e/androidruntime(623): android.app.supernotcalledexception: activity {com.example.zami/com.example.zami.splash} did not call through super.onpause()
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activity.performpause(activity.java:5110)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.instrumentation.callactivityonpause(instrumentation.java:1225)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activitythread.performpauseactivity(activitythread.java:2825)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activitythread.performpauseactivity(activitythread.java:2794)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activitythread.handlepauseactivity(activitythread.java:2772)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activitythread.access$800(activitythread.java:130)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activitythread$h.handlemessage(activitythread.java:1206)
06-05 22:33:47.050: e/androidruntime(623): @ android.os.handler.dispatchmessage(handler.java:99)
06-05 22:33:47.050: e/androidruntime(623): @ android.os.looper.loop(looper.java:137)
06-05 22:33:47.050: e/androidruntime(623): @ android.app.activitythread.main(activitythread.java:4745)
06-05 22:33:47.050: e/androidruntime(623): @ java.lang.reflect.method.invokenative(native method)
06-05 22:33:47.050: e/androidruntime(623): @ java.lang.reflect.method.invoke(method.java:511)
06-05 22:33:47.050: e/androidruntime(623): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786)
06-05 22:33:47.050: e/androidruntime(623): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553)
06-05 22:33:47.050: e/androidruntime(623): @ dalvik.system.nativestart.main(native method)
you have problem description in logs:
android.app.supernotcalledexception: activity {com.example.zami/com.example.zami.splash} did not call through super.onpause()
so, find onpause method in splash activity , call super.onpause() there.
update
you should call super methods in each lifecycle callback if want override in derived class.
Comments
Post a Comment