Reply To: Desktop (launcher) shortcuts not working if Magic DosBox is already running

#4039
admin
Keymaster

Unfortunately this is probably not possible. It’s all about android activities lifecycle and launch mode (magic dosbox uses singleTask for all activities). You must close mDosbox with back button or X. If you are interested look here :

Android: Understanding Activity launch mode

Magic Dosbox has two activities. First is main menu. Pressing game in menu finishes first activity and starts second activity (game).

Minimizing with home button does not close application immediately, in this case is closed by system when system needs more resources.

If you press icon from launcher then launcher sends newIntentEvent to main menu activity. And if intent contains game hash then is automatically closed main menu and started game (this is handled by mDosbox). This means you go always to main menu, you only don’t see it. Something is handled by system automatically, something by launcher and I can work only with result. If you press the icon from launcher then is on system what is started – it may start new main menu activity or it may resume to main menu. Which action is picked is handled by system. If is started new main menu activity and is present game hash is in startup parameters (inserted by launcher) then I start game else is started main menu.