Enable background start of Cordova Android apps

This closes #322
This commit is contained in:
Simon MacDonald 2016-09-18 16:00:53 -04:00 committed by Joe Bowser
parent f5ab6fc602
commit a4f6c8bf7b

View File

@ -28,6 +28,13 @@ public class __ACTIVITY__ extends CordovaActivity
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// enable Cordova apps to be started in the background
Bundle extras = getIntent().getExtras();
if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
moveTaskToBack(true);
}
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}