android - How to change the Theme of an activity after it is created? -



android - How to change the Theme of an activity after it is created? -

after creating activity, how can alter theme new one, example, theme.holo.

is possible?

you cannot alter theme of activity after created. can alter theme before views added, not after.

as per the docs settheme(int):

note should called before views instantiated in context (for illustration before calling setcontentview(view) or inflate(int, viewgroup)).

if wish alter theme before views added, can in oncreate() so:

public void oncreate(bundle savedinstancestate) { settheme(mythemeresourceid); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); }

android android-theme

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -