ivesingh
ivesingh

Reputation: 888

Request Window Feature from another class

I want the screen set to (Window.FEATURE_NO_TITLE). I know that I can put requestWindowFeature(Window.FEATURE_NO_TITLE); in the OnCreate method but I have another Class let's say Class B which is extended to the Fragment and it has a button in the layout. I want when that button is clicked in clicked in Class B, the Window should be shown without the Title. I tried as below:

AnandSahib anad = new AnandSahib();
anad.requestWindowFeature(Window.FEATURE_NO_TITLE);

Upvotes: 0

Views: 305

Answers (1)

user1525382
user1525382

Reputation:

I think you cant do it.you should call anad.requestWindowFeature(Window.FEATURE_NO_TITLE); before setContentView().please See this Android Developer site

Upvotes: 1

Related Questions