小编Ash*_*ish的帖子

如何在按钮单击 Android Studio 上启动 Instagram 应用程序

我只想在最低 API 16 上单击按钮(如果已安装)打开 Instagram 应用程序。

我正在尝试的是:

Intent likeIng = new Intent(Intent.ACTION_VIEW);

likeIng.setPackage("com.instagram.android");

try {
    startActivity(likeIng);
} catch (ActivityNotFoundException e) {

    Toast.makeText(this,"Instagram Not Installed!",Toast.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)

但是当在安装了 Instagram 的手机上运行时,它不会启动它。

android android-studio

0
推荐指数
1
解决办法
5723
查看次数

标签 统计

android ×1

android-studio ×1