简体   繁体   中英

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,

我添加了这个参数,它起作用了

        android:clearTaskOnLaunch="true"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM