Application keeps restarting

What causes an application to restart every time it is placed in the background, and when it returns it restarts?

How to use blocks correctly:

On App Pause
On App Resume
On App Stop
The Help text does not make it very clear.
In my case, do I specify how I would use one of these three blocks to avoid restarting it?

1 Like

I restarted my cell phone and the problem stopped. The mysterious thing that this reset only happened with this single app, the others were normal.

This helps you in when app paused by pressing Home Button .

This helps you in when user Return on the app after pausing it.

This helps you when, when user Stops the app permanently.

No, for more details see here:

Check this aia:

1 Like

I need to keep my app always open, but it always restarts when I click on its icon on the phone screen. In scree 1 in advanced mode, I already marked keeping the screen always on but it didn’t work.
I left the ON APP RESUME, ON APP STOP and ON APP PAUSE blocks active and empty, there is no use.
I do not know what else to do.
Other app does not happen, because I have several downloaded from the Play Store. Does this only happen with applications made in Kodular?

keep screen on means, the device will not go to sleep
this will not prevent the user from closing the app or pressing the home button
and clicking the app icon will start a new instance of the app… if you do not want that, find your app in the recents app list and open it from there

Taifun

I want him to be always on. Example: I opened the whatszap app, then I open the facebook app, then the instagran, then any other app. There are already 4 open apps. So I open my app totaling 6 open apps. So now I click on the facebook icon that is already open, and facebook now is the foreground app, so I click on my app icon and I want it to come back on the same screen that it was on. But it restarts and I don’t want it to restart, do you understand now?

I understand very well

Taifun

I didn’t understand the recent list ??

https://developer.android.com/guide/components/activities/recents
Taifun

@Taifun

I had already done that too, and even then there are times that it still restarts. This is very strange.
Use 2 Clocks, but I left them disabled and even then the problem occurs.

maybe your device don’t have enough ram to keep apps open in background.

I discard this possibility, because I kept it open, and by clicking on its logo it restarted too. my cell phone and a Motorola G6 32 memory. Else, I may have 10 apps open and it doesn’t.