android - Keep ActionBar from reverting changes -


i'm using activity webview , keep refreshing whenever device rotated, have android:configchanges="orientation|screensize" in androidmanifest.xml. problem whenever device rotated, changes have made status bar dissapear. know how keep webview refreshing whenever rotated , keep changes i've made in status bar?

this method use make changes statusbar

public static void changeactionbarfont(activity activity) {         typeface slab = typeface.createfromasset(activity.getassets(),                 "robotoslab.ttf");         int actionbartitle = resources.getsystem().getidentifier(                 "action_bar_title", "id", "android");         int actionbarsubtitle = resources.getsystem().getidentifier(                 "action_bar_subtitle", "id", "android");         if (0 == actionbartitle & 0 == actionbarsubtitle) {             actionbartitle = com.actionbarsherlock.r.id.abs__action_bar_title;             actionbarsubtitle = com.actionbarsherlock.r.id.abs__action_bar_subtitle;         }         textview title = (textview) activity.getwindow().findviewbyid(                 actionbartitle);         textview subtitle = (textview) activity.getwindow().findviewbyid(                 actionbarsubtitle);         if (title != null | subtitle != null) {             title.settypeface(slab);             subtitle.settypeface(slab);             subtitle.settextcolor(color.parsecolor("#ffffffff"));         }     } 

edit: removeing configchanges androidmanifest in fact fix problem actionbar, need them keep webview reloading whenever device rotated. have ideas how can keep them both?

it may not want hear right now, better try recreate layout in new orientation, rather preventing orientation change.

in oncreate check whether there saved instance (as result of orientation change) e.g.

if (savedinstancestate == null) {   //recreate current state } else {   //normal start } 

you might need retain values (either in shared prefs or onsavedinstancestate).

this approach more difficult locking orientation, better approach in long run , worth investment (extra effort).


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -