Android拒绝其他应用程序活动
我有以下代码打开其他应用程序活动:Android拒绝其他应用程序活动,android,android-activity,android-manifest,Android,Android Activity,Android Manifest,我有以下代码打开其他应用程序活动: Intent shortcutIntent = new Intent(activitate, MapFragment_.class); shortcutIntent.putExtra("instantly", true); shortcutIntent.putExtra("data", address); shortcutIntent.set
Intent shortcutIntent = new Intent(activitate, MapFragment_.class);
shortcutIntent.putExtra("instantly", true);
shortcutIntent.putExtra("data", address);
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
发送广播(快捷方式)
在我的清单中:
<activity
android:name=".MapFragment_.class"
android:authorities="com.mobi.android.xyz"
>
</activity>
怎么了?您没有使用startActivity()。加上这个
Intent shortcutIntent = new Intent(activitate, MapFragment_.class);
shortcutIntent.putExtra("instantly", true);
shortcutIntent.putExtra("data", address);
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(shortcutIntent);
首先阅读:我在“MapFragment_u2;.class”(上面的第一行)上有红色字符:“无法解析符号MapFragment_2;.class”是我当前的类快捷方式
Intent shortcutIntent = new Intent(activitate, MapFragment_.class);
shortcutIntent.putExtra("instantly", true);
shortcutIntent.putExtra("data", address);
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(shortcutIntent);