相关疑难解决方法(0)

为什么活动中的getApplicationContext().setTheme()不起作用?

我目前很难getApplicationContext().setTheme()在一个活动中调用,我只是想在应用程序范围中应用主题资源而不是代码样式中的活动范围,但问题是这根本不起作用,任何人都可以向这个.

非常感谢.!

他是代码骨架:

public class StartUp extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    /*
     * setTheme(android.R.style.Theme_Black_NoTitleBar_Fullscreen);
     * //that works!
     */
       this.getApplicationContext().setTheme(
            android.R.style.Theme_Black_NoTitleBar_Fullscreen);
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
    }
}
Run Code Online (Sandbox Code Playgroud)

android themes

12
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×1

themes ×1