Main repository of MikuMikuStudio
Revision | 0a9630b033b75d6b5a3833aff786553511fbf0d6 (tree) |
---|---|
Time | 2013-05-19 12:58:15 |
Author | iwgeric@gmail.com <iwgeric@gmai...> |
Commiter | iwgeric@gmail.com |
SDK: Add SingleTask Launch Mode to AndroidManifest for new projects to avoid starting a new instance of the app when users hit the Home button and then resume the app.
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10627 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -290,6 +290,28 @@ public class AndroidSdkTool { | ||
290 | 290 | in.close(); |
291 | 291 | in = null; |
292 | 292 | boolean changed = false; |
293 | + Element sdkApplication = XmlHelper.findChildElement(configuration.getDocumentElement(), "application"); | |
294 | + if (sdkApplication != null) { | |
295 | + Element sdkActivity = XmlHelper.findChildElement(sdkApplication, "activity"); | |
296 | + if (sdkActivity != null) { | |
297 | + if (!sdkActivity.hasAttribute("android:launchMode")) { | |
298 | + sdkActivity.setAttribute("android:launchMode", "singleTask"); | |
299 | + changed = true; | |
300 | + } | |
301 | + } | |
302 | + // add the following after AndroidHarness.screenOrientation is depreciated | |
303 | + // for jME 3.1 | |
304 | +// if (sdkActivity != null) { | |
305 | +// if (sdkActivity.hasAttribute("android:screenOrientation")) { | |
306 | +// String attrScreenOrientation = sdkActivity.getAttribute("android:screenOrientation"); | |
307 | +// } else { | |
308 | +// Logger.getLogger(AndroidSdkTool.class.getName()).log(Level.INFO, "creating attrScreenOrientation"); | |
309 | +// sdkActivity.setAttribute("android:screenOrientation", "landscape"); | |
310 | +// changed = true; | |
311 | +// } | |
312 | +// } | |
313 | + } | |
314 | + | |
293 | 315 | Element sdkElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "uses-sdk"); |
294 | 316 | if (sdkElement == null) { |
295 | 317 | sdkElement = configuration.createElement("uses-sdk"); |