android - Hide tittle bar in ActionBarActivity using java code -
this question has answer here:
how hide title bar android actionbaractivity have tried did not success.
getting exception :
java.lang.runtimeexception: unable start activity componentinfo{com.dan.msdashboard/com.dan.msdashboard.firstactivity}: android.util.androidruntimeexception: requestfeature() must called before adding content
but using code
protected void oncreate(bundle savedinstancestate) { // requestwindowfeature(window.feature_no_title); super.oncreate(savedinstancestate); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); // hide title bar of activity screen this.supportrequestwindowfeature(window.feature_no_title); setcontentview(r.layout.activity_simple);
please me solve .
thanks in advance....
once try follows
// requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); // hide title bar of activity screen this.supportrequestwindowfeature(window.feature_no_title); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_simple);
hope helps you.
Comments
Post a Comment