1

This is my code for upi implicit intent which gives user of option to choose multiple upi supported application and the code is working fine on all the devices i have tested and all the version except Redmi Devices. My code is not working on any Redmi Note 5 Pro

Here is my code :

String UPI = "upi://pay?pa=abcupi@xxxxbank&pn=:ABC%20COMPANY%20LTD&tr="+dateTime+"&am="+amount+"&tn=XXXXXX UPI Payment";
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.setData(Uri.parse(UPI));
        Intent chooser = Intent.createChooser(intent, "UPI Transfer With");
        startActivityForResult(chooser, UPI_CHOOSER, null);

The chooser is not opening upi supported apps only on Redmi devices. I have tested on 3 different Redmi note 5 pro but it didn't work. Its not opening the chooser to show upi supported apps.

bipin
  • 1,091
  • 4
  • 12
  • 30

1 Answers1

0

Here is how I solved it for Redmi Note 5 Pro:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(UPI));
if (intent.resolveActivity(getPackageManager()) != null) {
    startActivity(intent);
} else {
    Toast.makeText(this, "No application available to handle this request!", Toast.LENGTH_SHORT).show();
}