2015-10-16 62 views
-1

我有followind代碼來打開其他應用活動:的Android oppening其他應用程序活動

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> 

而且我recive:

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

有什麼不對?

+0

首先閱讀:http://developer.android.com/guide/components/intents-filters.html –

回答

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

我對「MapFragment_.class」(上面第一行)的紅色大字:「能不解析符號MapFragment_.class「 – Corneliu

+0

什麼是激活? – 2015-10-16 07:34:33

+0

我目前的課程快捷方式 – Corneliu

相關問題