I know that if you have to test the onrestoreinstance() the system must kill previously the application. Is there any easy way to test that? I mean not going to open tons of other applications for the system to kill it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your AndroidManifest.xml does not block Activity’s kill-restore on device rotations, then you can just rotate the device (or emulate device rotation if on emulator).
There is also another cool tool – on the emulator by default you should have ‘Dev Tools’ app installed. Open it and go to ‘Development Settings’, then check the ‘Don’t keep activities’ checkbox. Since this moment the activities will be killed by OS as soon as they become invisible (in the background). So pressing ‘Home’ button will cause a kill for your activity. Then on the home screen pressing your app icon will restore your activity.