2015-12-02 143 views
0

您好我正在为Android创建一个示例启动器应用程序。但是当运行我的示例启动器应用程序时出现错误,如“不幸的是,SimpleLauncher已停止。”示例启动器应用程序未启动在Android中

我强烈地感觉到这个错误可能是因为我的清单文件有问题,所以我附上我的清单文件,请帮我解决问题。

<?xml version="1.0" encoding="utf-8"?> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen" 
     android:launchMode="singleTask" 
     android:stateNotNeeded="true" 
     > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.HOME" /> 
      <category android:name="android.intent.category.DEFAULT" /> 

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

    <activity 
     android:name=".AppsListActivity" 
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
     > 
    </activity> 

</application> 

+0

能否请您发表的logcat – Abhijeet

+0

安置自己的logcat –

+0

的[可能的复制不幸的是MyApp的已停止。我怎样才能解决这个问题?](http://stackoverflow.com/questions/23353173/uncomfort-myapp-has-stopped-how-can-i-solve-this) – Selvin

回答

0

编辑清单作品只是fine..unless你想要做一些花哨的东西在你的应用程序。

<application 
android:allowBackup="true" 
android:icon="@mipmap/ic_launcher" 
android:label="@string/app_name" 
android:theme="@style/AppTheme" > 
<activity 
    android:name=".MainActivity" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" 
    > 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 
</activity> 

<activity 
    android:name=".AppsListActivity"/> 

您styles.xml

<resources> 

    <!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <!-- Customize your theme here. --> 
    </style> 

</resources> 
+0

更改编辑后的清单后,也会得到与先前评论中提到的相同的错误和相同的logcat错误。 – Ganesh

+0

更新了答案 – johnrao07

0

你logcat中提到,您需要使用程序兼容性主题。 转到您styles.xml,改变AppThemeTheme.AppCompat

相关问题