RSS

Search Engine

Saturday, November 6, 2010

Hide The Title Bar In Android

Hello Friends,

This are the basic tutorials for hiding the title bar. In this tutorials we have discussed about how to hide the title bar in android.

You have to create new project.

In this project your main.xml file given below.

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>

And now your hide.java file given below.

hide.java

package com.hide;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class hiding extends Activity {


/** Called when the activity is first created. */

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
}


So this are the simple code for hiding the title bar in android.

3 comments:

Anonymous said...

Great man, thanks a lot, I was looking for this.

Susan said...

How would you show OR hide the title bar?
How would you do it, by a button click?

Anonymous said...

very simple and easy way thank you

Post a Comment