Tuesday, 15 June 2010

android - Why getApplicationContext().setTheme() in a Activity does not work? -


I currently have difficult time calling to get ApplicationContext (). In an activity setTheme (), I just want to apply the code in the style of the field instead of the activity area in an application area, but the problem is that it does not work at all, nobody can explain it, thank you very much !

That code is the skeleton:

  increases the public class startup activity {@ Override Crate on public spell (bundled saved instenestate) {/ * * settheme (android. R.style.me_Black_NoTitleBar_Fullscreen); * //Does it work! * / This.getApplicationContext () Settheme (android.r.style.Theme_Black_NoTitleBar_Fullscreen); Super.onCreate (savedInstanceState); SetContentView (R.layout.main); }  

}

Find a way to do Only God knows why, but I have also seen the Android Framework engineers (I believe it was Diane Hackborne) that it is discouraging to set such a theme.

Set the subject of your activity in the manifest instead, and it will work.


No comments:

Post a Comment