android - How to change background color of custom view placed in actionbar? -


what did

view v=getlayoutinflater().inflate(r.layout.action_bar, null);         v.setbackgroundresource(r.color.primary_color); actionbar.setcustomview(v); 

everything worked fine how again change color of custom view below statement not working why.

getactionbar().getcustomview().setbackgroundcolor(color.parsecolor("#3f51b5")); 


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -