Android fullscreen activity without battery icon - android

I am developing an android application which contains a full screen activity but i am unable to hide default android battery , time etc. icons from the screen
For example :-
I think this is something like android immersive full screen view
So can any one tell me how can i achieve this

you can do it in java file by
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
or in AndroidManifest.xml
<activity android:name=".ActivityName"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>
With transparent notification bar read this link.

There is a new feature called Immersive FullScreen mode where all the UI elements other than your Activity are hidden. One can get those those back by swiping down.
Use the following code to achieve this :
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

Related

Android full screen tablet app

I want to display android app in full screen for tablets.
I thought of using view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); to hide navigation but the problem is that I have buttons in my view. If I hide navigation like this, every time user want's to click butto, on first click the menu shows up but the button isn't clicked.
I wouldn't care if the menu shows or not after click but I don't want users to ask to click twice to choose something.
What would be the suggested way to display my app in full screen?
use this code:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Just Edit your Manifest.xml file:
Use this code if you want to display all the Activities in Full Screen Mode:
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
...
</application>
Use this code if you want to display some Activities in Full Screen Mode:
<activity
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
...
</activity>
I hope this helps.
You can write this line in Activity on onCreate method :
this.requestWindowFeature((int)Window.FEATURE_NO_TITLE);
SYSTEM_UI_FLAG_HIDE_NAVIGATION will cause those navigation controls to just disappear.There is a limitation: because navigation controls are so important, the least user interaction will cause them to reappear immediately.

How to avoid showing the title bar when phonegap app starts on Android?

I have a splash screen for my phonegap app on android. However, everytime before showing the splash screen, a blank screen with a header bar (an icon with the app name) will be shown before the splash screen. How do I make that disappear?
Try requestWindowFeature(FEATURE_NO_TITLE) in your activity's onCreate() method
if you could go for fullscreen as well then this may help if you add this in your mainfest -
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">

Why does initial blank activity show on startup?

In my android app I have an initial activity which popup a dialog (used as the splash screen). I am doing this:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Popup a fullscreen dialog (used as splash)
showSplashScreen();
}
However there is a small time period before this where a blank empty with my logo and title bar show up. I have no idea how to remove this from showing at all. I even tried to see if this was coming from the same activity, I check by removing the title bar by requesting no title bar. However, I had no luck... This mysterious blank activity shows up for a small time interval.
How do apps like facebook show an initial splash screen first without showing anything else before?
use setContentView(R.layout.layout_name); in the code.
Describe the Activity that you want to open as a dialogue in the manifest file as:
<activity
android:name=".Description_Activity"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Dialog" >
</activity>
requestWindowFeature(Window.FEATURE_NO_TITLE);
in onCreate or
android:theme=”#android:style/Theme.NoTitleBar”
in your activity tag of manifest should hide the title bar.
And please make sure this activity is your first activity on start.
I've added the following line to my custom style:
<item name="android:windowDisablePreview">true</item>

Notification Bar visibility

My application is running landscape mode and I have set the following property of activity in manifest file
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
It surely hides the notification bar when my activity is running. But when for suppose I launch browser activity from my app and returns, the notification bar is visible again. I am trying to find its solution nothing is working. I followed the following link but in vain.
Hidden notification bar reappearing after screen lock and unlock
Any idea?
I handle these things in my java code
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
The nice part of handling this in java is you can release those flags at any time to get rid of full screen. I put this before setContent but I can't recall if that it required or not.
If this doesn't keep it fullscreen you could try to put it in the onResume(), which is my guess how your losing it.

TabActivity Implementing

I am trying to make a tab activity. It works fine . I make
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" in the definition in manifest file. But sometimes it does not take the full screen when launching. My program starts from a splash screen. That is an normal activity. My tab is at the buttom of the screen. So the tabs are go inside the screen.
Does Anyone know about the problem?
Remove .FullScreen and instead use
android:theme="#android:style/Theme.NoTitleBar"
with your activity tags in AndroidManifest.XML, worked out for me
EDIT
in your Activity onCreate method use
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Categories

Resources