{"id":4193,"date":"2014-03-30T09:10:19","date_gmt":"2014-03-30T09:10:19","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/app-is-crashing-after-home-is-pressed-unable-to-pause-derived-class-did-not-call-super-onsaveinstancestate-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:10:19","modified_gmt":"2014-03-30T09:10:19","slug":"app-is-crashing-after-home-is-pressed-unable-to-pause-derived-class-did-not-call-super-onsaveinstancestate-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/app-is-crashing-after-home-is-pressed-unable-to-pause-derived-class-did-not-call-super-onsaveinstancestate-collection-of-common-programming-errors\/","title":{"rendered":"App is crashing after Home is pressed. Unable to pause &#8211; Derived class did not call super.onSaveInstanceState()-Collection of common programming errors"},"content":{"rendered":"<p>I have a problem with my application and I would love some help.<\/p>\n<p>When I press the Home button, the app should be paused, save all state and work fine \ud83d\ude42 instead i get this error:<\/p>\n<p>Below some code from my app.<\/p>\n<blockquote>\n<p>java.lang.RuntimeException: Unable to pause activity {be.test.tester\/be.test.tester.DataScreen}: java.lang.IllegalStateException: Derived class did not call super.onSaveInstanceState() at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3641) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3598) at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3574) at android.app.ActivityThread.access$2500(ActivityThread.java:136) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2186) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:5068) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at dalvik.system.NativeStart.main(Native Method)<\/p>\n<p>Caused by: java.lang.IllegalStateException: Derived class did not call super.onSaveInstanceState() at android.view.View.dispatchSaveInstanceState(View.java:6087) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:1207) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:1207) at android.view.View.saveHierarchyState(View.java:6068) at com.android.internal.policy.impl.PhoneWindow.saveHierarchyState(PhoneWindow.java:1475) at android.app.Activity.onSaveInstanceState(Activity.java:1106) at android.app.Activity.performSaveInstanceState(Activity.java:1056) at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1289) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3623) &#8230; 12 more<\/p>\n<\/blockquote>\n<p>My activity reacts on touch:<\/p>\n<pre><code>public class DataScreen extends Activity implements OnGestureListener{   \n<\/code><\/pre>\n<p>I&#8217;m getting some extra&#8217;s from the intent:<\/p>\n<pre><code>totUsage = Integer.parseInt(getIntent().getStringExtra(\"extraTotUsage\"));\n    limit = Integer.parseInt(getIntent().getStringExtra(\"extraLimit\"));\n    Bundle bundle = getIntent().getExtras();\n    mylist = (ArrayList) bundle.get(\"extraMyList\");\n<\/code><\/pre>\n<p>A custom view is showing data (canvas): When you scroll on screen, data changes in custom view ( set,get method ) and redraws itsef.<\/p>\n<p>I don&#8217;t really manage the onSaveInstanceState here, don&#8217;t really know if i have to.<\/p>\n<p>My app is onTop of the stack, because of :<\/p>\n<pre><code>i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n<\/code><\/pre>\n<p>I don&#8217;t understand the error.<\/p>\n<p>Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a problem with my application and I would love some help. When I press the Home button, the app should be paused, save all state and work fine \ud83d\ude42 instead i get this error: Below some code from my app. java.lang.RuntimeException: Unable to pause activity {be.test.tester\/be.test.tester.DataScreen}: java.lang.IllegalStateException: Derived class did not call super.onSaveInstanceState() [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4193","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4193"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4193\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}