1

Is there a way to remove permanently from the application those two android navigation bars? enter image description here

sazz
  • 3,193
  • 3
  • 23
  • 33

3 Answers3

5

Yes, you need to make your application fullscreen to remove the android soft-keys at the bottom. Examples and documentation here for fullscreen:

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

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


To remove the title bar and optionally the navigation bar, in your manifest xml file:

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

Or

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

Answer borrowed from here

Community
  • 1
  • 1
Husman
  • 6,819
  • 9
  • 29
  • 47
0

Easiest way. Put this in your activity where contentView is your base element in your xml (e.g LinearLayout)

     @Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus) {
        contentView.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);}
}
Pontus Backlund
  • 1,017
  • 1
  • 10
  • 17
0

this is the eseist way I figure

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class ActivityName extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // remove title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
    }
}
codermaster
  • 156
  • 11