Android应用程序崩溃-原因未知
我是一个初学者,一直在使用树屋学习。我很早就开始学习了,当我启动应用程序时,突然收到一条崩溃消息。我不确定发生了什么事。我已经发布了我所知道的一切。对不起,如果我错过了什么或张贴太多 主要内容: 水晶球:Android应用程序崩溃-原因未知,android,crash,Android,Crash,我是一个初学者,一直在使用树屋学习。我很早就开始学习了,当我启动应用程序时,突然收到一条崩溃消息。我不确定发生了什么事。我已经发布了我所知道的一切。对不起,如果我错过了什么或张贴太多 主要内容: 水晶球: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.crystalba
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.crystalball"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<activity
android:name="com.example.crystalball.MainActivity"
android:label="@string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
您的活动扩展了
ActionBarActivity
public class MainActivity extends ActionBarActivity
表示您正在使用AppCompat
,在这种情况下,您需要将从Theme.AppCompat
派生的Theme
设置为活动
或
设置应用程序的主题以简单地添加ActionBar Compat您的活动或应用程序应在
AndroidManifest.xml
中使用@style/theme.AppCompat
主题,如下所示:
<activity
...
android:theme="@style/Theme.AppCompat" />
到
请换
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
到
将
android:theme=“@android:style/theme.Black.NoTitleBar.Fullscreen”
更改为android:theme=“@android:style/theme.AppCompat”
”此活动需要使用theme.AppCompat主题(或子代)。
“
public class MainActivity extends ActionBarActivity
android:theme="@style/Theme.AppCompat" >
<activity
...
android:theme="@style/Theme.AppCompat" />
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:theme="@style/Theme.AppCompat"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:theme="@android:style/Theme.AppCompat"