0

Hi I am creating one sample launcher application for Android. But When running my sample launcher application am getting error like "Unfortunately, SimpleLauncher has stopped."

I Strongly feel that this error is may be because of something wrong with my manifest file, so I am attaching my manifest file, Please help me to solve the problem.

<?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>

Ganesh
  • 89
  • 3
  • 14
  • Can you please post a logcat – Abhijeet Dec 02 '15 at 12:09
  • Possible duplicate of [Unfortunately MyApp has stopped. How can I solve this?](http://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this) – Selvin Dec 02 '15 at 12:09
  • 1
    This is one of the error in logcat. 12-02 17:40:36.370 4862-4862/com.example.ganesh.simplelauncher E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.example.ganesh.simplelauncher, PID: 4862 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ganesh.simplelauncher/com.example.ganesh.simplelauncher.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. – Ganesh Dec 02 '15 at 12:15

2 Answers2

0

This edited manifest works as just fine..unless you wanna do some fancy stuff in your app.

<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"/>

your styles.xml

<resources>

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

</resources>
johnrao07
  • 6,690
  • 4
  • 32
  • 55
  • after changing the edited manifest also Am getting same error & same logcat error as mentioned in previous comment. – Ganesh Dec 02 '15 at 12:22
0

Your Logcat mentioned that you need to use an AppCompat theme. Go to your styles.xml and change the AppTheme to Theme.AppCompat

Akshay Bhat 'AB'
  • 2,690
  • 3
  • 20
  • 32