我正在开发一个系统应用程序(
system/priv-app/
)。当我向AndroidManifest
中的一个活动添加一个新的意图过滤器操作并将新的apk推送到priv-app并尝试使用adb shell(也来自第三方应用程序)启动该活动时,我得到Error: Activity not started, unable to resolve Intent { act=com.example.SETTINGS flg=0x10000000 }
。
将应用程序推送到 priv-app 后尝试重新启动。
清单
<activity android:name=".ui.activity.AppSettingsActivity"
android:launchMode="singleTop"
android:exported="true">
<meta-data android:name="distractionOptimized" android:value="true"/>
<intent-filter>
<action android:name="com.example.SETTINGS"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
使用以下 adb 命令启动该活动
adb shell am start -a com.example.SETTINGS
来自第三方应用程序
startActivity(new Intent("com.example.SETTINGS"));