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