简体   繁体   English

主题不适用于活动

[英]Themes don't apply on activity

To apply a theme on an activity, you have to add the theme from (Manefest file) like this: 要在活动上应用主题,您必须添加(Manefest文件)主题,如下所示:

 <activity
        android:name=".Forth"
        android:label="@string/title_activity_forth"
        android:theme="@android:style/Theme.Dialog">

The app starts normally, but when I click the button to stat the (dialog activity), the app fall-down/? 该应用程序正常启动,但当我单击按钮来统计(对话框活动)时,应用程序会掉线/?

and when I remove the theme (android:theme="@android:style/Theme.Dialog") , 当我删除主题(android:theme="@android:style/Theme.Dialog")

the app works perfectly. 该应用程序完美。

Please provide me with solution for this problem. 请为我提供这个问题的解决方案。 I am running Android Studio 1.1.0 我正在运行Android Studio 1.1.0

OK, I just solved it. 好的,我刚解决了。 It's because my Activity was inheriting from ActionBarActivity. 这是因为我的Activity继承自ActionBarActivity。 I make it inherit from Activity and now it's working. 我让它继承自Activity,现在它正在运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM