you need to use a theme.appcompat theme (or descendant) with this activity 解决办法

当你想隐藏

Androidmanifest.xml

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar"

    >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

类文件:

public class MainActivity extends ActionBarActivity i

出现的异常:

解决办法如下:

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:theme="@style/Theme.AppCompat.NoActionBar"

    >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

类文件:

public class MainActivity extends Activity
时间: 2024-08-15 07:17:51

you need to use a theme.appcompat theme (or descendant) with this activity 解决办法的相关文章

开发中遇到的问题(一)——java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

1.错误描述: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 2.起因: 在Manifest中设置我的activity全屏 1 <activity android:name=".SplashActivity" 2 android:theme="@android:style/Theme.Black.No

You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法

报错如下:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test2/com.example.test2.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 解决方法:创建的activity是M

关于引用Theme.AppCompat theme的报错问题

建立V7包库(Library)项目以供其他项目引 Chapter: 使用support-v7 ActionBar前的那些坑 1. 建立V7包库(Library)项目以供其他项目引用 2. v7库项目themes_base.xml相关文件报错问题 3. 关于引用Theme.AppCompat theme的报错问题 以前3.0以前的版本要使用ActionBar,必须使用国外大牛写的ActionBarSherlock这个开源项目.2013年的Google I/O大会之后,Google官方在androi

Android You need to use a Theme.AppCompat theme (or descendant) with this activity.

错误描述为:java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 起因:我想在Manifest中设置我的activity全屏,代码如下: <activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar.

我的Android进阶之旅------&gt;解决错误:You need to use a Theme.AppCompat theme (or descendant) with this activity.

#1.错误描述 今天,想实现Activity不显示标题栏的效果,在项目的AndroidManifest.xml文件,对相应的Activity添加属性 android:theme="@android:style/Theme.NoTitleBar" 具体代码如下: <activity android:name=".module.view.activity.KuwoMusicPlayActivity" android:theme="@android:sty

java.lang.IllegalStateException: You need to use a theme.appcompat theme (or descendant) with this activity

错误描述:java.lang.IllegalStateException: You need to use a theme.appcompat theme (or descendant) with this activity 产生原因:Activity继承自AppCompatActivity,在style.xml中使用了不兼容的Theme. 从错误提示中提到Theme.AppCompat theme,这是因为我们的activity一定是继承了兼容包中的类,比如我这里就无意中继承了AppCompa

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme

配置: 中设置theme为 <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:theme="@android:style/Theme.Light.NoTitleBar" android:label="@string/app_name" > 报错信息: 09-20 10:31:58.185 1392-1

关闭 You need to use a Theme.AppCompat theme (or descendant) with this activity解决方法

当我的MainActivity继承自v7包中的ActionBarActivity或者AppCompatActivity时,如果在style.xml文件中指定MainActivity所使用的样式如下: [java] view plain copy <style name="AppTheme" parent="android:Theme.Material.NoActionBar"> <!-- 5.0开始,可以在Style.xml文件中统一配置App的样

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