vaibvorld
vaibvorld

Reputation: 389

unable to remove title bar?

i have a layout ,i want layout to be displayed on whole screen without title bar. onCreate method of my activity :

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.home);



    }

still getting gray title bar at top.

Upvotes: 0

Views: 214

Answers (3)

Rajendra
Rajendra

Reputation: 1698

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);// try  this
    setContentView(R.layout.home);

Upvotes: 0

Chirag
Chirag

Reputation: 56925

Set the android:theme="@android:style/Theme.NoTitleBar" at application level in the manifest file.

<application
        android:icon="@drawable/ic_launcher"
        android:label="@string/name"
        android:theme="@android:style/Theme.NoTitleBar" >

Upvotes: 1

Gan
Gan

Reputation: 1399

you can disable the title bar by specifying it in the application manifest.

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

Upvotes: 0

Related Questions