How to re-activate an application waiting in memory

DOM85

Active Member
Licensed User
Longtime User
Hi,

When my application is run for a second time, i would like to re-activate the last one waiting in memory. Is it possible?
Thanks.
 

DOM85

Active Member
Licensed User
Longtime User
This is will happen by default.

Thank you Erel for your answer.

Do you mean that when i quit my running app by pressing the home button, if run my app a second time, in fact it is the first one that reappears?

If so, the "FirstTime" parameter on Activity_Create is only used to restore data.

Thank for your good help.
 
Upvote 0

Djembefola

Active Member
Licensed User
Longtime User
Try the following code:

B4X:
Sub Process_Globals
    Dim StartTime As Long
End Sub

Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then StartTime = DateTime.Now
    activity.Title = "I was started " & DateTime.Time (StartTime)   
End Sub

As long as Android does not decide to kill the process, you will see after every start of your app the same time in the title bar.
 
Last edited:
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Do you mean that when i quit my running app by pressing the home button, if run my app a second time, in fact it is the first one that reappears?

It depends. The conditions under which your app may or may not start up again where it left off are explained at the link in my previous message.

How to handle the different conditions is also explained there.
 
Upvote 0

DOM85

Active Member
Licensed User
Longtime User
Try the following code:

B4X:
Sub Process_Globals
    Dim StartTime As Long
End Sub

Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then StartTime = DateTime.Now
    activity.Title = "I was started " & DateTime.Time (StartTime)   
End Sub

As long as Android does not decide to kill the process, you will see after every start of your app the same time in the title bar.

I tried your example by displaying time with a msgbox, and you are right !!! Each time i run again my app without leaving the first run, it is the first run that appears!
Thank you!!!
 
Upvote 0

DOM85

Active Member
Licensed User
Longtime User
It depends. The conditions under which your app may or may not start up again where it left off are explained at the link in my previous message.

How to handle the different conditions is also explained there.

I understand. Your link is very useful.
Thank you!
 
Upvote 0
Top