2016-12-14 1092 views
0
Intent hashtagIntent = new Intent(Intent.ACTION_VIEW, 
        Uri.parse("com.instagram.android")); 
      startActivity(hashtagIntent); 

我試圖從我的應用程序啓動instagram應用程序。 我已經嘗試了上面的代碼,但未能打開Instagram應用程序。如何從另一個應用程序打開instagram啓動器活動

+0

您嘗試啓動應用程序包,而你需要開始一個活動。 @VishalChhodwani回答顯示如何從應用程序包 –

回答

2

嘗試這個

它會幫助你肯定

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.instagram.android"); 
if (launchIntent != null) 
{ 
    try 
    { 
     startActivity(launchIntent); 
    } 
    catch (ActivityNotFoundException ex) // in case Instagram not installed in your device 
    { 
     ex.printStackTrace(); 
    } 
} 
+0

工作得到啓動器活動,非常感謝 – Biswatma

+0

這是我的榮幸:) –

+0

如果我希望應用程序在啓動後打開特定用戶帳戶,該怎麼辦? –

相關問題