• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
3
Question by Oana · Jun 23, 2014 at 03:06 PM · androidmanifest

How to set Android launchMode from Unity

I am trying to change the launchMode of Unity's activity from "singleTask" to "standard". However, if I just change it in the AndroidManifest file in Plugins/Android, it gets reverted to "singleTask" when building (seen in the output project in tmp). If I export it to Eclipse and change the manifest there, it all compiles and runs fine.

In essence, I am looking for a way to change UnityPlayerActivity's launch mode from "singleTask" to "standard" without exporting to an eclipse project.

Any ideas? Thanks in advance.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image spruce · Aug 07, 2014 at 05:50 PM 0
Share

hello, are u find any solutions?

avatar image Smart-pupils · Dec 17, 2014 at 10:18 AM 0
Share

hi are u fix it and find some solutions ?

avatar image Oana · Dec 30, 2014 at 03:06 PM 0
Share

It seems the only way to do this is indeed to export to Eclipse.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by spruce · Aug 08, 2014 at 09:23 AM

Try comment this meta-data In AndroidManifest:

 <meta-data android:name="unityplayer.UnityActivity" android:value="true"/>

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by liortal · Aug 08, 2014 at 08:50 PM

You need to provide your own custom AndroidManifest.xml and place it under Plugins/Android (or a subfolder under it).

I just tried doing that and it works fine.

Unity (according to the documentation) will pick up all AndroidManifests and merge them together with the main manifest as mentioned in this link: http://docs.unity3d.com/Manual/PluginsForAndroid.html

You can drop pre-compiled Android library projects into the Assets->Plugins->Android folder. Pre-compiled means all .java files must have been compiled into jar files located in either the bin/ or the libs/ folder of the project. AndroidManifest.xml from these folders will get automatically merged with the main manifest file when the project is built.

Here is the manifest i used (put under Plugins/Android, make sure to change the package name to whatever you configured in your project!!) :

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.product">
   <application android:icon="@drawable/app_icon" android:label="@string/app_name">
     <activity android:name=".UnityPlayerActivity"
              android:label="@string/app_name"
              android:launchMode="standard"
              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
         <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
     </activity>
   </application>
 </manifest>
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Oana · Dec 30, 2014 at 03:05 PM 0
Share

Late reply: I did this, but it actually gets switched back when compiling!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I replace correctly the main activity on the Android Manifest? 0 Answers

I use Unity 5.2.2. Android Manifest It gives error. What can I do ? 0 Answers

my android build is of 29mb but when i install it ,size become 50mb in device 0 Answers

google market filter by screen 1 Answer

Parse push notification doesn't show 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges