• 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 question was closed Jul 12, 2014 at 10:16 PM by Razacx for the following reason:

Other

avatar image
0
Question by Razacx · Jul 11, 2014 at 12:07 AM · android

Hiding the navigation/system bar in Android

I'm currently trying to develop a game for android and have stumbled upon a problem. When playing the game on an android device, the touch-navigation bar shows for devices that don't have any hardware navigation buttons.

alt text

Normally when you make an android app, you can hide this bar by adding the following value to the activity in your android manifest file:

 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

This however did not work, even tough it does with non-unity apps. If anybody knows of another way to achieve my desired result, I would be very pleased to hear it.

Edit:

I just tried using Screen.SetResolution(int width, int height, bool fullscreen), but this didn't work either.

whats_new_nav_bar.png (4.0 kB)
Comment
Add comment · Show 2
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 Yury-Habets ♦♦ · Nov 30, 2014 at 08:19 AM 0
Share

First of all, I assume you have "Status bar hidden" selected in the player settings.

The thing you are looking for is called "immersive fullscreen mode", supported starting from $$anonymous$$it$$anonymous$$at. It will be supported out-of-box in Unity 5, in the meanwhile you can write a plugin or use one from the Asset Store: https://www.assetstore.unity3d.com/en/#!/content/21774 https://www.assetstore.unity3d.com/en/#!/content/16852

avatar image Razacx · Nov 30, 2014 at 11:48 AM 0
Share

I actually answered my own question a few months ago in one of the comments down below :p.

3 Replies

  • Sort: 
avatar image
1

Answer by liortal · Jul 12, 2014 at 09:39 PM

Looking at the Activity code that Unity uses on Android, it seems like they're calling setTheme with some custom theme.

This means that setting your own theme in the manifest probably won't help.

 protected void onCreate(Bundle paramBundle)
   {
     requestWindowFeature(1);
     super.onCreate(paramBundle);
     getWindow().takeSurface(null);
     setTheme(16973831);
     getWindow().setFormat(4);
     this.mUnityPlayer = new UnityPlayer(this);
     if (this.mUnityPlayer.getSettings().getBoolean("hide_status_bar", true))
       getWindow().setFlags(1024, 1024);
     setContentView(this.mUnityPlayer);
     this.mUnityPlayer.requestFocus();
   }

You can export your project as a "Google Android Project" and edit the activity class to not do override the theme.

EDIT:

According to this link: http://developer.android.com/reference/android/R.style.html The theme set IS Theme_NoTitleBar_Fullscreen. So my proposed solution is no good.

Note that Unity checks for the "hide_status_bar" which looks promising. This is a setting that can be found under "Player Settings". Make sure it is checked if you want to hide the status bar.

Comment
Add comment · Show 4 · 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 Razacx · Jul 12, 2014 at 10:16 PM 0
Share

Thanks alot for doing all this research for me. But it seems I wasn't really searching for the right stuff. What I needed was something called "Immersive $$anonymous$$ode", which was introduced in api level 19.

https://developer.android.com/training/system-ui/immersive.html

I was able to correctly implement it in the google android project, and now everything works as intended. :)

avatar image liortal · Jul 13, 2014 at 08:39 PM 0
Share

Cool. good to learn something new

avatar image Espion15 · Nov 30, 2014 at 03:09 AM 0
Share

Hi, I know it's few years ago :) But in case you will read this once :D How did you implement immersive mode in Google Android project?

avatar image Razacx · Nov 30, 2014 at 11:50 AM 0
Share

I didn't, I used one of the plugins from the asset store since I was to lazy to figure it out. https://www.assetstore.unity3d.com/en/#!/search/immersive%20mode

avatar image
0

Answer by Landern · Jul 11, 2014 at 12:15 PM

Have you tried putting it at the application level in the manifest?

 ...
 <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
 ...
Comment
Add comment · Show 3 · 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 Razacx · Jul 11, 2014 at 01:09 PM 0
Share

I just tried it, and it does not work :/

avatar image liortal · Jul 11, 2014 at 09:34 PM 0
Share

Are you sure you are updating the manifest correctlyÞ

avatar image Razacx · Jul 11, 2014 at 11:54 PM 0
Share

liortal, I'm not a beginner with Unity and have experience with writing apps for android (in java). So I'm sure there are no mistakes in the manifest file and that it's being used correctly.

avatar image
-1

Answer by Vitor_r · Jul 12, 2014 at 02:51 PM

There is no way to do this without Root permission.

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

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

26 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 avatar image avatar image avatar image

Related Questions

Playmaker Touch Actions for Android 0 Answers

How do i fit my android game for all screen sizes and resolution 1 Answer

How to use Sqlite3 in Unity for android 0 Answers

Merging multiple build.gradle file 0 Answers

Problem with "Saved by batching" 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