Exaplain how to Hide Action Bar Title in android, programmatically . Show the example-
The method hide the action bar title. requestWindowFeature(Window.FEATURE_NO_TITLE) and call before setContentView(R.layout.activity_main).
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
public class HideTitle_bar extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
}
}
My activity_main class
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</LinearLayout>
0 comments