Can config.xml set android:launchMode?

599 views
Skip to first unread message

Chris

unread,
Sep 24, 2013, 12:09:24 PM9/24/13
to phon...@googlegroups.com
I put this in my Android app's manifest xml so it would resume, not restart each time the user returns to it. 
<activity .... android:launchMode="singleTask"> 

However - every time I run $ cordova build my Android manifest xml files loses this. How can I work around this? Is there a setting I can put in config.xml to retain this in my android manifest after the build?

Dan Moore

unread,
Sep 24, 2013, 10:45:03 PM9/24/13
to phon...@googlegroups.com
Hi Chris,

I don't think you can put a setting in your config.xml yet to keep this android setting, but I'd file a jira bug about it: https://issues.apache.org/jira/browse/CB

Until then you can use a hook to copy your modified AndroidManifest.xml to the platforms/android directory (using the after_build hook).  Be aware that if you add plugins that modify AndroidManifest.xml, you'll need to make those changes to your modified AndroidManifest.xml file.

--
Dan Moore
Developing with Cordova CLI

Chris

unread,
Sep 25, 2013, 5:29:07 AM9/25/13
to phon...@googlegroups.com
Thanks Dan - appreciate your input. 

Dan Moore

unread,
Sep 26, 2013, 12:02:44 AM9/26/13
to phon...@googlegroups.com
Hi Chris,

I hope I'm not beating the hook bandwagon too much--I really like them, though.

Would love to hear if you think of/find another solution.


--
Dan Moore
Developing with Cordova CLI


Reply all
Reply to author
Forward
0 new messages