This question already has answers here:
full screen application android
(8 answers)
Closed 5 years ago.
What is the best way to hide permanent system bar on android?
I want a full-screen app without system bar.
All that I got so far is hide the bar, but if I swipe up it appears.
Any suggestion?
try this
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Related
This question already has answers here:
Android - Simulate Home click
(4 answers)
Closed 1 year ago.
How to programmatically, e.g. using a button, make the app switch to background mode. Actually, I mean the action that the "home screen button" does, but I want to programmatically do it on my button. Thanks.
finish();
System.exit(0);
Cause exited from app.
you can use below backstack function to move the app to background mode:
moveTaskToBack(true)
This question already has answers here:
Change orientation at runtime
(3 answers)
Closed 4 years ago.
I have been developing an audits app and want one of my screens not to rotate using the sensors. I don't want to change the manifest but want to do this by using java
any help would be appreciated.
To Make your application run only in portrait mode:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
To Make your application run only in landscape mode:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Note: Use it before setContentView method.
Use one of the following to restrict to specific orientation:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); // for portrait
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // for landscape
This question already has answers here:
How do I change the background color of the ActionBar of an ActionBarActivity using XML?
(21 answers)
Closed 6 years ago.
I'am using Android Studio 2.1.2 and want to change the color of my Action bar.
How I can do this? But with XML.
Please give me a detailed description to solve this problem
Thanks!
Use this:
ActionBar bar = getActionBar();
bar.setBackgroundDrawable(new ColorDrawable("COLOR"));
This question already has answers here:
How to add icons to items in a navigation drawer
(2 answers)
Closed 8 years ago.
Does anyone know how to add icons like this in the navigation drawer?
http://i.stack.imgur.com/JvzOb.png
(cant add images until I have 10 rep. points)
The content of the DraweLayoutis a ListView. So, you must set a custom adapter to the ListView, providing on the getView method the view desired. A good tutorial.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Problem with Image Button visibility! Android
When you start the application, the buttons should be visible for 5 seconds and then become invisible, so people will know there are buttons on the screen. For example If I have a MapActivity running, the button will be an obstruction. So I want to make it invisible. It should be visible again on touching that area or around that button area so as to trigger another activity. I tried setting visibilitiy. nextbutton.setVisibility(View.INVISIBLE) I can't make it visible onTouch() Please help me with the problem.
See your original thread which has more than enough information for you to do what you want.