android - how to make actionbar and tabs transperant -


to keep google's new i've tried make 2 top bars transparent , hasn't worked out ie. errors/ no change occurs

here's activity make tabs (not sure if should set or not)

 @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);       mtitle = mdrawertitle = gettitle();      // load slide menu items     navmenutitles = getresources().getstringarray(r.array.nav_drawer_items);      // nav drawer icons resources     navmenuicons = getresources()             .obtaintypedarray(r.array.nav_drawer_icons);      mdrawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout);     mdrawerlist = (listview) findviewbyid(r.id.list_slidermenu);      navdraweritems = new arraylist<navdraweritem>();      // adding nav drawer items array     // home     navdraweritems.add(new navdraweritem(navmenutitles[0], navmenuicons.getresourceid(0, -1)));     navdraweritems.add(new navdraweritem(navmenutitles[1], navmenuicons.getresourceid(1, -1)));     navdraweritems.add(new navdraweritem(navmenutitles[2], navmenuicons.getresourceid(2, -1), true, "22"));     navdraweritems.add(new navdraweritem(navmenutitles[3], navmenuicons.getresourceid(3, -1)));     navdraweritems.add(new navdraweritem(navmenutitles[4], navmenuicons.getresourceid(4, -1), true, "+10"));     navdraweritems.add(new navdraweritem(navmenutitles[5], navmenuicons.getresourceid(5, -1)));      getactionbar().setdisplayhomeasupenabled(true);      getwindow().requestfeature(window.feature_action_bar_overlay);     actionbar actionbar = getactionbar();     actionbar.setbackgrounddrawable(new colordrawable(color.parsecolor("#330000ff")));     actionbar.setstackedbackgrounddrawable(new colordrawable(color.parsecolor("#550000ff"))); 

enter image description here

that gives me error. i'm using custom theme. i'm doing wrong i'm aware code above meant activity. there i'm missing in styles or putting in wrong activity in advance.

if you're doing fragment need call:

getactivity().getwindow() 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -