Hide the Title bar in an Android View by using the Window Class
Had to hunt around for this in the Android documentation so I thought I’d mention it in case anyone else could utilize it. In my new shopping list application I want to display dynamic information in the title bar and didn’t want to display the default title bar. I knew it could be done from looking at the application view screen on the Android Market. There is a flag in the Window class to hide the title bar, and it’s placed in the onCreate method of an Activity.
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
...
I was expecting to find a setter method in either the Activity or the View class. After hiding the title bar, I simply added a TableLayout to the top of my View to display the information.
I’m not exactly sure what the relationship is of the Window to the View or the Activity other then what is already documented in the Window API and Google’s glossary for Android, maybe I’ll get some time in the future to poke around a bit more.

October 23rd, 2009 at 1:43 am
What is the import for Window.FEATURE…..
October 23rd, 2009 at 1:47 am
AMOQ (answered my own question)
import android.view.Window;
Thanks for the useful tip on hiding Title Bar!
October 23rd, 2009 at 1:50 am
Now, how do you hide the bar above that with the battery and stuff on it

February 1st, 2010 at 1:52 am
it’s better to do this in your application manifest: see http://developer.android.com/guide/appendix/faq/commontasks.html#configurewindowproperties
February 21st, 2010 at 11:24 am
[…] Hide the Title bar in an Android View by using the Window Class | mgmblog.com. […]