I would like to know if there is a corresponding way to open a pinterest link with pinterest app if is installed, or with the browser if it is not in the device like Facebook. For Facebook I use the following code
final String urlFb = "fb://page/" + "profile_id";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(urlFb));
// If a Facebook app is installed, use it. Otherwise, launch
// a browser
final PackageManager packageManager = getPackageManager();
List<ResolveInfo> list =
packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() == 0) {
final String urlBrowser = "https://www.facebook.com/" + "profile id";
intent.setData(Uri.parse(urlBrowser));
}
startActivity(intent);