簡體   English   中英

如何從另一個應用程序打開Instagram啟動器活動

[英]How to open instagram launcher activity from another app

 Intent hashtagIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("com.instagram.android"));
            startActivity(hashtagIntent);

我正在嘗試從我的應用程序啟動instagram應用程序。 我已經嘗試了上面的代碼,但是無法打開Instagram應用程序。

嘗試這個

絕對可以幫到您

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM