Hide Activity Title

Description

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  av  a 2  s  . com*/
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");
    }
}
Hide Activity Title




















Home »
  Android »
    Android Basics »




Hello Android
Resources
Activity
Calendar
Camera
Contact
Content Provider
Database
Hardware
Intent
Location
Media
Network
Notification
Preference
Sensor
Service
SMS