androidandroid-launcherandroid-reboot

Android - Launcher Application breaks after reboot phone


Here is my manifest:

<application
    android:allowBackup="true"
    android:icon="@drawable/toto"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    android:process=":app_process">
    <activity
        android:name=".core.Main"
        android:label="app_label"
        android:launchMode="singleTask"
        android:alwaysRetainTaskState="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <action android:name="android.nfc.action.TECH_DISCOVERED" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <meta-data
            android:name="android.nfc.action.TECH_DISCOVERED"
            android:resource="@xml/nfc_tech_filter" />
    </activity>

    <service android:name=".core.MessengerService"
        android:enabled="true"
        android:process=":app_process">
        <intent-filter>
            <action android:name="My_Messenger_Service"/>
        </intent-filter>
    </service>

    <receiver
        android:name=".core.BootReceiver"
        android:enabled="true"
        android:label="StartMyServiceAtBootReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

</application>

My launcher breaks after reboot phone, then the phone asks me to choose the default launcher which contains Android default launcher and my launcher.

I tried to get logcat by using command line:

adb logcat -d > logcat.txt 

But I didn't find any error log E/ of my launcher. How can I trace this error?

Can someone helps me pls? Thanks,


Solution

  • I added this param and it worked

            android:clearTaskOnLaunch="true"