How to stop (not kill) an action to run onRestart ()?

I am working on an Android application. Our problems appear when the user launches our application, moves through the home or back button and returns later. From the official annotation of the documentation on the activity life cycle and Eric Burke, it is useful to reformat the life cycle diagram , I suspect that our activity begins to kill when it stops, but (critically) is not destroyed.

In other words, running functions are called onPause(), onStop(), onRestart(), onStart()and onResume(). Note that this means that it onRestart()is called in the middle instead of onCreate (), which will happen if the application is simply killed and deleted from memory. This, I think, is the problem.

This is a setting. The question arises here: is there a way so that I can reliably make the application stop , so that I can reproduce this condition. I do not want to kill the application, and I do not want it to just be paused.

Is there an adb command? DDMS? Is there something in the phone?

I tried to fake it by running other memory-dependent applications, but that always just leads to it being killed directly, which means the application runs everywhere and onCreate starts and I don’t recognize anything.

+3
source share
1 answer

, , . , , .

HOME.

+2

Source: https://habr.com/ru/post/1777125/


All Articles