Home > Tricks & Tips > Activity with no title bar

Activity with no title bar


If you don’t want your Activity to have title bar, then just disable it.

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE); // <--- this is what u need
        setContentView(R.layout.main);
    }
}

This is what u have after.

No Title Bar

No Title Bar

Hope you enjoy it!

 

Cheers,

Pete Houston

Categories: Tricks & Tips Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: