• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Link doesn't go to Instagram app

SamoZain

Newbie
I wanted to have a click to instagram in the application I'm making, the thing is, when I click on it, it goes to the browser, I wanted to go to Instagram natgeotravel application, if there was no Instagram application in my mobile, it goes to the browser
Here is the code

Code:
if (uri.contains("https://www.instagram.com/" )) {
 String natgeotravel = "natgeotravel";
 String uri1 = "instagram://Page/" + natgeotravel;
 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
 startActivity(intent);

 } else {

 String natgeotravel= "natgeotravel";
 String uri1 = "https://www.instagram.com/" + natgeotravel;
 Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
 startActivity(i);
 }
 }
 });
I even tried ! at the beginning of uri but still didn't work, it comes with a msg You must log out in order to reset your password and Sorry, we weren't able to load that link
Help :)
 
Back
Top Bottom