Android How to - Hide Activity Title








You can hide the title of an activity.

Example

Use the requestWindowFeature() method and pass it the Window.FEATURE_NO_TITLE.

package com.java2s.app;
//from   w ww  .j a v  a 2  s .co  m
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //---hides the title bar---
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.activity_main);
        Log.d(tag, "In the onCreate() event");
    }
}
null