app.SendIntent() restarted DroidScript

84 views
Skip to first unread message

Abu Ibrahim Myria

unread,
Aug 18, 2017, 3:42:38 AM8/18/17
to DroidScript
I am trying to open a web browser using SendIntent(), however, DroidScript seems to be restarting itself when I called it, any information why it does that or how to prevent? My main activity contains a websocket server, when I use SendIntent(), it will restart DroidScript thus I lost list of websocket clients connected to my app.

Steve Garman

unread,
Aug 18, 2017, 3:59:57 AM8/18/17
to DroidScript
If you start a new app and your device is low on resources, Android will remove inactive apps from memory.
It is quite likely that DroidScript is the only app available for this action.

You may need to save your settings before sending the intent and restore them in OnResume

If the resources are just low and not running out, it is possible that using app.OpenUrl instead of your own intent will make DroidScript slightly less likely to appear inactive.

If this is an option for you, I would recommend trying it.

Another possibility is to examine whether you really need to open a browser or can you display a WebView instead.

Reply all
Reply to author
Forward
0 new messages