check screen state before start activity screen STATE = true

check screen state before start activity screen STATE = true
Activity (has extras)} from uid 10915 on display 0

一个app通过 scheme协议调起另一个app的activity时,第一次能调起,后续无法调起,报错如下:

2022-03-10 18:49:17.650 20993-21966/? E/ActivityManager: check screen state before start activity screen STATE = true
2022-03-10 18:49:17.683 20993-21966/? I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=xv://com.kedacom.intelligentcommunity.maanshan/UpsReceiveActivity cmp=com.kedacom.intelligentcommunity.maanshan/com.kedacom.intelligentcommunity.view.activity.UpsReceiveActivity (has extras)} from uid 10915 on display 0
2022-03-10 18:49:17.683 20993-21966/? D/ActivityManager: sAllowedServices  length= 0
2022-03-10 18:49:18.075 20993-22043/? I/ActivityManager: Setting hasTopUi=false for pid=21289
2022-03-10 18:49:28.952 20993-21552/? I/ActivityManager: Setting hasTopUi=true for pid=21289
2022-03-10 18:49:30.993 20993-21990/? I/ActivityManager: Setting hasTopUi=false for pid=21289
2022-03-10 18:49:38.751 20993-22045/? I/ActivityManager: Setting hasTopUi=true for pid=21289

解决办法:

设置启动模式为: android:launchMode=“singleTask”

        <activity
            android:name=".view.activity.UpsReceiveActivity"
            android:launchMode="singleTask"
            android:exported="true">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
                <action android:name="android.intent.action.VIEW" />
                <data
                    android:host="com.kedacom.intelligentcommunity.maanshan"
                    android:path="/UpsReceiveActivity"
                    android:scheme="xv" />
            </intent-filter>
        </activity>

你可能感兴趣的:(代码块,scheme,launchMode,app唤起)