Can't Remove Activity Title in My Android Project With minSdkVersion=9, targetSdkVersion=21 -


i new android. trying hide title bar of activity failed every time.

my style.xml

<resources>      <!-- base application theme. -->     <style name="apptheme" parent="theme.appcompat.light.darkactionbar">         <!-- customize theme here. -->     </style>  </resources> 

failed attempt 1

requestwindowfeature(window.feature_no_title); 

failed attempt 2

final actionbar actionbar = getactionbar();  actionbar.setdisplayshowtitleenabled(false); 

failed attempt 3

<activity android:name=".mainactivity" android:label="@string/app_name" android:theme="@android:style/theme.black.notitlebar.fullscreen"> 

my activity

public class jobdetailsview extends actionbaractivity {      @override     protected void oncreate(bundle savedinstancestate) {           this.requestwindowfeature(window.feature_no_title);         this.getwindow().setflags(windowmanager.layoutparams.flag_fullscreen,                 windowmanager.layoutparams.flag_fullscreen);         super.oncreate(savedinstancestate);           setcontentview(r.layout.activity_job_details_view);     } } 

can help??

add these style in resource file.

  <style name="appbasetheme" parent="theme.appcompat.light.darkactionbar">  </style>  <!-- application theme. --> <style name="apptheme" parent="appbasetheme">          <item name="android:windownotitle">true</item>      </style> 

and add theme application , activity,

android:theme="@style/apptheme" 

in manifest file,hope should work.

note:keep in mind should not extend actionbaractivity instead try activity in activity class.then work.

happy coding.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -