Hide App

etLux

Member
Licensed User
Longtime User
Is it possible to "hide" an app?

For instance, say I wanted the app to just
play a sound (and quit) -- without showing
any visible interface...?

Thanks!

David
-----
David Sosnowski
www.DavidSosnowski.com
 

etLux

Member
Licensed User
Longtime User
Thanks, Erel; that does the trick nicely.
There's sort of a zoomy dramatic effect
that's rather cool... lol.

But this leads to a question about the
Android life cycle that I'm not "getting".

In this application, I start MediaPlayer.Play
and immediately thereafter call Activity.Finish.

Yet, the MediaPlayer continues to play through
the sound file to its end after Activity.Finish is
called (likewise if the back button is clicked).

In the tutorial it says Activity.Finish "pauses and
destroys the current activity, similar to the Back
button
".

Is MediaPlayer somehow an exception -- or do I
misunderstand what Activity.Finish actually does?

Thank you!



David
-----
David Sosnowski
www.DavidSosnowski.com
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
MediaPlayer is not an "activity object". You have probably declared it in Sub Process_Globals. These objects are not destroyed when the activity is destroyed as they belong to the process and not to the specific activity.
They will only be destroyed when Android OS decides to kill the process.

Secondly the music playing is done with an internal OS service. So even if the media player is destroyed the music can continue playing.
 
Upvote 0
Top