This acts like the user pressed the home button on their device:
Sub ShowHomeScreen 'programmatically press the Home button on the Android device
Dim i As Intent
i.Initialize(i.ACTION_MAIN, "")
i.AddCategory("android.intent.category.HOME")
i.Flags = 268435456
StartActivity(i)
End Sub
(I think this is Erel's code)
So if in your code you do
ShowHomeScreen
then your application will disappear into the background.
If you have a piece of code in your application that can then later do something like:
StartActivity("main")
(or any other of your activities)
Then your app will magically appear again.
It is true that while your app is sitting in the background the system might decide to trash it, there are ways around this.
In my app I have a service, when I do ShowHomeScreen it zooms off into the background but its still working! I can get it to play sounds, TTS speach, Toast pop up messages etc. Then bring it back to the foreground again at will.
One more thing, that ShowHomeScreen sub really does act like someone pressed the home key, try pressing the home key several times on your device to see what I mean.