Li Che
Li Che

Reputation: 737

How to set the title not display?

It can remove title by setting requestWindowFeature(Window.FEATURE_NO_TITLE) in onCreat(). But the title display first, then disappear. How could the title not display? Could it set in manifest file?

Upvotes: 0

Views: 172

Answers (5)

Digvesh Patel
Digvesh Patel

Reputation: 6533

just permission in activity which u want to have no title

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

Upvotes: 1

Siddharth Lele
Siddharth Lele

Reputation: 27748

You should always use the requestWindowFeature(Window.FEATURE_NO_TITLE) before using the setContentView

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.your_layout);

}

Upvotes: 0

Techwolf
Techwolf

Reputation: 1228

If you just want the default theme and no title, you can put this in your manifest file:

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

You can also set it from the Theme drop-down menu above your layout in eclipse.

Upvotes: 0

Mehul Ranpara
Mehul Ranpara

Reputation: 4255

use like this way..

 public void onCreate(Bundle savedInstanceState) 
 {

        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
 }

Upvotes: 0

Deepanker Chaudhary
Deepanker Chaudhary

Reputation: 1704

Use like this in your manifest file:-

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

Upvotes: 3

Related Questions