Android Show Custom Nav and Footer on Tap Like ImageViewer - android

I want to show activity full screen and want to Show/Hide Custom Title bar with back button and footer with one button only. Just like Full screen Image Viewer Android
like If my activity is :
When i touch and tap anywhere in screen it should be like:
Update
I have searched a lot but haven't find proper solution. I want do with Android 4.2 Jelly Bean (API level 17).
I got a solution [Immersive Full-Screen Mode]3 but this is for Android 4.4 KitKat (API level 19).
Any advice would be appreciated!

Try this now:
activity_main.xml :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rlMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#f2af2a" >
</RelativeLayout>
MainActivity.java :
public class MainActivity extends Activity {
Handler mHandler = new Handler();
RelativeLayout rlMain;
Runnable mRunnable = new Runnable() {
#SuppressLint("NewApi")
#Override
public void run() {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.HONEYCOMB)
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
};
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
rlMain = (RelativeLayout) findViewById(R.id.rlMain);
mHandler.postDelayed(mRunnable, 1500);
rlMain.setOnClickListener(new View.OnClickListener() {
#SuppressLint("NewApi")
#Override
public void onClick(View arg0) {
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.HONEYCOMB) {
if (!(getWindow().getDecorView().getSystemUiVisibility() == View.SYSTEM_UI_FLAG_VISIBLE)) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
} else {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
mHandler.removeCallbacks(mRunnable);
mHandler.postDelayed(mRunnable, 3500);
}
});
}
}

Related

How to remove the black bar appearing at the bottom?

I am new to Android Development. I want my app to support the screen size of my device i.e. 1080 x 2160 pixels. Currently there is a black bottom bar that is displayed in place of where the navigation buttons would have been.
Please note that I do not want Full Screen Mode. I have disabled the button navigation on my device. It is only for this app that that the bottom black rectangle is showing.
I just want my app to support the gesture navigation system of my device instead of buttons.How do I make the bottom bar go away using Java (Android Studio) so that my app utilizes that space?
question is old but I faced the same issue and didnot find the solution on SO.
this problem occurs for long screens
We recommend that you design your app to support aspect ratios of 2.1 or higher. For this, you would add the following to the "application" element in your Manifest file:
<meta-data android:name="android.max_aspect" android:value="2.1" />
from here
I had the same issue, updated manifest file with this or remove if you have one.
before
<meta-data
android:name="android.max_aspect"
android:value="2.1" />
after
<meta-data
android:name="android.max_aspect"
android:value="2.4" />
working for me now.
Hi please Try below code
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
You can try this
#Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
Try to add this code
#Override
protected void onCreate(Bundle savedInstanceState) {
...
hideSystemUI(this, 1000);
}
#Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
// Hide bar after 1 second
hideSystemUI(this, 1000);
}
}
public static void hideSystemUI(#NonNull final Activity activity, final int delayMs) {
View decorView = activity.getWindow().getDecorView();
int uiState = View.SYSTEM_UI_FLAG_IMMERSIVE
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
final Handler handler = new Handler();
decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
#Override
public void onSystemUiVisibilityChange(int visibility) {
if (visibility == View.VISIBLE) {
Runnable runnable = new Runnable() {
#Override
public void run() {
hideSystemUI(activity, 1000);
}
};
handler.postDelayed(runnable, delayMs);
}
}
});
decorView.setSystemUiVisibility(uiState);
}
WARNING
If you have two activities, add this before changing
View decorView = getWindow().getDecorView();
decorView.setOnSystemUiVisibilityChangeListener(null);

Android - How to unhide soft buttons after programatically hiding them?

Some android phones have soft buttons (back, home, menu). I manage to hide them using setSystemUiVisibility as described here.
However, how to make the softbuttons visible pragmatically?
You can use setSystemUiVisibility()
Request that the visibility of the status bar or other screen/window decorations be changed.
SAMPLE CODE
public class MainActivity extends AppCompatActivity {
TextView tvTextView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
setContentView(R.layout.activity_main);
tvTextView=findViewById(R.id.tvTextView);
tvTextView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
getWindow().getDecorView().setSystemUiVisibility(View.VISIBLE);
}
});
}
Setting View.SYSTEM_UI_FLAG_VISIBLE worked for me.
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);

How to make my Activity as Full Screen mode in Android? [duplicate]

This question already has answers here:
Fullscreen Activity in Android?
(40 answers)
Closed 5 years ago.
I have an App and SDK, both are different. I included my SDK into my App. Now the problem is I have issues with making my activity in fullscreen. In SDK, classes are NON-Activity class there is no GUI, only backend Process. so I want to make them Full screen view. Here I can not use:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Because my activity Non-activity class so there is no more window.so plan to use this code,
ws.setJavaScriptEnabled(true);
htmlAd.addJavascriptInterface(new Object()
{
#JavascriptInterface
public void performClick(String strl)
{
Activity activity = (Activity) adViewContext;
if(strl.equals("base")){
View mDecorView = activity.getWindow().getDecorView();
Toast.makeText (activity, "ONE" + strl, Toast.LENGTH_SHORT).show();
mDecorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE);
}else{
View mDecorView = activity.getWindow().getDecorView();
Toast.makeText (activity, "TWO" + strl, Toast.LENGTH_SHORT).show();
mDecorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
}
}, "ok");
But it does not work, please guide me .
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
adjustFullScreen(newConfig);
}
#Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
adjustFullScreen(getResources().getConfiguration());
}
}
private void adjustFullScreen(Configuration config) {
final View decorView = getWindow().getDecorView();
if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
}
change your application level theme to
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>

Sticky immersive mode disabled after soft keyboard shown

I have an app that needs to be full screen most of the time. I know that if an alert is shown or other window is displayed, over the top of the activity window, full screen is temporarily removed. Unfortunately, when a soft keyboard is shown for an EditText or something, when the user has finished with the keyboard, full screen immersive mode is not restored.
Any idea how this can be achieved?
Taken from this sample app by Google, you need to append this to the end of your activity, before the last end bracket:
#Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
// When the window loses focus (e.g. the action overflow is shown),
// cancel any pending hide action. When the window gains focus,
// hide the system UI.
if (hasFocus) {
delayedHide(300);
} else {
mHideHandler.removeMessages(0);
}
}
private void hideSystemUI() {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_LOW_PROFILE |
View.SYSTEM_UI_FLAG_IMMERSIVE
);
}
private void showSystemUI() {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
}
private final Handler mHideHandler = new Handler() {
#Override
public void handleMessage(Message msg) {
hideSystemUI();
}
};
private void delayedHide(int delayMillis) {
mHideHandler.removeMessages(0);
mHideHandler.sendEmptyMessageDelayed(0, delayMillis);
}
And you should be good. :)
I put this code at onCreate() observer the layout changes
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
#Override
public void onGlobalLayout() {
Rect rect = new Rect();
getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
int screenHeight = getWindow().getDecorView().getRootView().getHeight();
int keyboardHeight = screenHeight - rect.bottom;
if (keyboardHeight > screenHeight * 0.15) {
setToImmersiveMode();
}
}
});
private void setToImmersiveMode() {
// set to immersive
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
I suggest extending AppCompatActivity into a new class (ImmersiveAppCompatActivity). By doing this, any activity that you create using this class will have built in handling of immersive mode.
If you try and set immersive mode too quickly after the soft keyboard has appeared, it will not hide.
Also note that the handler has been improved by switching to a static handler - this will prevent leaks if the user leaves the activity before the GUI is hidden.
public abstract class ImmersiveAppCompatActivity extends AppCompatActivity {
private HideHandler mHideHandler;
#Override
protected void onCreate(#Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// create a handler to set immersive mode on a delay
mHideHandler = new HideHandler(this);
}
#Override
protected void onResume() {
super.onResume();
setToImmersiveMode();
}
#Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if(hasFocus) {
mHideHandler.removeMessages(0);
mHideHandler.sendEmptyMessageDelayed(0, 300);
}
else mHideHandler.removeMessages(0);
}
private void setToImmersiveMode() {
// set to immersive
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
private static class HideHandler extends Handler {
private final WeakReference<ImmersiveAppCompatActivity> mActivity;
HideHandler(ImmersiveAppCompatActivity activity) {
mActivity = new WeakReference<>(activity);
}
#Override
public void handleMessage(Message msg) {
ImmersiveAppCompatActivity activity = mActivity.get();
if(activity != null) activity.setToImmersiveMode();
}
}
}
Here's the Kotlin version:
abstract class ImmersiveAppCompatActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
setToImmersiveMode()
}
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
val runnable = Runnable { setToImmersiveMode() }
val handler = Handler(Looper.getMainLooper())
handler.postDelayed(runnable, 300)
}
private fun setToImmersiveMode() {
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_FULLSCREEN
or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
}
}
Now, create your activity using this class:
public class SettingsActivity extends ImmersiveAppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment()).commit();
}
}
I've tested this in Android 5.1 and 7.0 to work in a full screen app that has no action bar.
Additionally, if you using the keyboard in an EditText be aware of the imeOptions. In landscape mode you can get strange full screen editing behavior. This can be disabled by setting imeOptions flags which are contained in the class EditorInfo:
<EditText
android:layout_width="#dimen/pin_width"
android:layout_height="wrap_content"
android:inputType="numberPassword"
android:imeOptions="flagNoExtractUi"
android:ems="10"
android:id="#+id/editTextPIN"
android:textSize="#dimen/pin_large_text_size"/>
https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html
This is the normal behaviour. But you can fix it in two steps :
1. Find out when the keyboard is hidden
2. Set the immersive fullscreen mode (again)
Step 1 is a little bit tricky. You can check out my answer here:
https://stackoverflow.com/a/27567074/2525452
Step 2 is simple:
public static void setImmersiveMode( Activity activity )
{
// Get the Activity's content View
ViewGroup content = (ViewGroup) activity.findViewById( android.R.id.content );
//
// Set the immersive mode flags at the content View
content.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
);
}
To keep immersive mode as it is while soft input enabled and typing. You need to set flags to your activity window. Not to Decor view.
YourActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
To remove it do just,
YourActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
Also keep your system UI visibility settings as you want on decor view.

Using new IMMERSIVE mode in android kitkat

I want to make an activity to go into IMMERSIVE mode and hide top and buttom system bars as soon as it starts.
In developers site of android they say I should use setSystemUiVisibility() and provide SYSTEM_UI_FLAG_IMMERSIVE and SYSTEM_UI_FLAG_HIDE_NAVIGATION.
How can I do this in the OnCreate() method of the activity? I think the setSystemUiVisibility is not provided in the Activity class and it should happen in a view. Is there a workaround?
UPDATE
ok According to doorstuck I added the following lines but I dont see any changes, navigation bar and buttom buttons are still visible :
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
}
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE);
}
//Rest of activity code
Get the decor view:
getWindow().getDecorView().setSystemUiVisibility(...)
Remember that the arguments are bit flags. Only call the method above once:
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE);
Chris Banes gist shows a nice Helper Class we can use to set the immersive mode for all Versions from HoneyComb to Lollipop https://gist.github.com/chrisbanes/73de18faffca571f7292.
Update:
I tried get it from his github repo to include in my project, but i had to clone the gist files into my project and adjsut the packagename. If someone knows how to include it properly as a dependency, u r welcome to help me.
I added it in my FullScreenActivity i want to use the ImmersiveStickyMode like this:
#Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
final int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
SystemUiHelper uiHelper = new SystemUiHelper(this, SystemUiHelper.LEVEL_IMMERSIVE ,flags);
uiHelper.hide();
}
You can create global function to go into immersive mode like:
public static void enableImmersiveMode(final View decorView) {
decorView.setSystemUiVisibility(setSystemUiVisibility());
decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
#Override
public void onSystemUiVisibilityChange(int visibility) {
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
decorView.setSystemUiVisibility(setSystemUiVisibility());
}
}
});
}
public static int setSystemUiVisibility() {
return View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
Above code will also control system UI visibility change. Hope this will help you.
Much nicer and credit to William J. Francis:
public class GameActivity extends Activity{
#Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
/* my code you dont need this
assets=getAssets();
sGame= new GameView(this, GAME_WIDTH, GAME_HEIGHT);
setContentView(sGame);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
*/
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
#Override
protected void onDoSomethingOtherImportantThing(){
...
}
}
Answer has already been given but here is How to utilize Immersive mode.
In your activity:
just before setContentview().......
call the method: toggleHideyBar();
Follow documentation documentation from Developer android and copy this method in your Activity.
android:immersive="true" will hide the Bottom system bars
<application>
<activity
android:name=".CarrierActivity"
android:label="#string/app_name"
android:excludeFromRecents="true"
android:immersive="true"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="com.example.SetupWiz.SUW_CARRIER"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

Categories

Resources