Braydon Batungbacal
Braydon Batungbacal

Reputation: 1038

Android PhoneGap App - Force Closing when pressing "Back"

I'm having an issue with a phonegap / jquerymobile app I'm developing. Everything works, except if you open up the app and press the back button before navigating to any other page, it force closes the app and says unexpected force close. If you navigate to any other page of the app and then press back, it goes to the previous page as it should.

Here is what my log is throwing when pressing back..

05-05 22:29:29.878: E/AndroidRuntime(1524): FATAL EXCEPTION: main
05-05 22:29:29.878: E/AndroidRuntime(1524): android.app.SuperNotCalledException: Activity {com.slammednavigator/com.slammednavigator.SlammedNavigatorActivity} did not call through to super.onDestroy()
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3101)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3130)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.app.ActivityThread.access$1200(ActivityThread.java:123)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1180)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.os.Looper.loop(Looper.java:137)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at android.app.ActivityThread.main(ActivityThread.java:4424)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at java.lang.reflect.Method.invokeNative(Native Method)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at java.lang.reflect.Method.invoke(Method.java:511)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-05 22:29:29.878: E/AndroidRuntime(1524):     at dalvik.system.NativeStart.main(Native Method)

Upvotes: 0

Views: 710

Answers (1)

Sam
Sam

Reputation: 86958

Without code I can only guess that you need to add:

super.onDestroy();

to your overriden onDestroy() function in your main activity.

Upvotes: 2

Related Questions