Android oppening其他应用程序活动

时间:2015-10-16 07:20:21

标签: android android-activity android-manifest

我有followind代码打开其他应用活动:

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);

sendBroadcast(shortcutIntent);

在我的清单中:

<activity
    android:name=".MapFragment_.class"
    android:authorities="com.mobi.android.xyz"
    >

</activity>

我回忆道:

 android.content.ActivityNotFoundException: Unable to find explicit activity class

出了什么问题?

1 个答案:

答案 0 :(得分:0)

您尚未使用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);