I'm creating an android app where in user have the option to launch amazon prime app from within my app. i am unable to find package name for amazon prime app. This code only open amazon prime in browser.
public void onClick(View v) {
String urlAmazonPrime = "https://www.primevideo.com";
Intent intentAmazonPrime = new Intent(Intent.ACTION_VIEW, Uri.parse(urlAmazonPrime));
intentAmazonPrime.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intentAmazonPrime.setPackage("com.amazon.amazonvideo.livingroom");
try {
response = "success";
startActivity(intentAmazonPrime);
} catch (ActivityNotFoundException ex) {
// Chrome browser presumably not installed so allow user to choose instead
intentAmazonPrime.setPackage(null);
startActivity(intentAmazonPrime);
response = "notfound";
Toast.makeText(MainActivity.this, "Amazon Prime Not Found", Toast.LENGTH_SHORT).show();
}
}