Reputation: 105
Intent hashtagIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("com.instagram.android"));
startActivity(hashtagIntent);
I'm trying to launch the instagram app from my app. I have tried the code above, but it failed to open the Instagram app.
Upvotes: 0
Views: 3811
Reputation: 2577
Try This
It will help you definitely
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();
}
}
Upvotes: 2