Android studio使用android:style/Theme.Dialog报错:You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)

查找原因是在activity java代码部分继承了compatactivity

public class DialogActivity extends AppCompatActivity

但是在AndroidManifest.xml里面确定义成Dialog,

<activity android:name=".DialogActivity"
android:theme="@android:style/Theme.Dialog">
</activity>

解决方法是修改activity java代码,继承Activity即可:

public class DialogActivity extends Activity

Android studio使用android:style/Theme.Dialog报错:You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)

上一篇:Android dp、dpi、px


下一篇:Javascript 仿苹果导航菜单