0

我有WebView。在網站上,我點擊社交按鈕(Facebook,Twitter,VK,OK,Instagram,電報)。工作是VK,Twitter,YouTube和電報。當我點擊這個社交按鈕時,我需要啓動應用程序(如果它安裝在我的手機上),但它僅在WebView中啓動。WebView intent Facebook和Instagram

回答

0

您必須使用Intent來啓動已安裝的應用程序。傳遞包名稱以啓動應用程序。

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address"); 
if (launchIntent != null) { 
    startActivity(launchIntent);//null pointer check in case package name was not found 
}