Created
June 23, 2022 10:57
-
-
Save aabhasr1/9a8be690f0c7735f23f70d2ee53021d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String url = "upi://"; | |
String gpay = "com.google.android.apps.nbu.paisa.user"; | |
String phonepe = "com.phonepe.app"; | |
String paytm = "net.one97.paytm"; | |
String bhim = "in.org.npci.upiapp"; | |
String others = "others.upiapp"; | |
final Intent intent = new Intent(); | |
intent.setAction(Intent.ACTION_VIEW); | |
intent.setData(Uri.parse(url)); | |
runOnUiThread(() -> { | |
if ("others.upiapp".equals(appPkg)) { | |
Intent chooser = Intent.createChooser(intent, "Pay with"); | |
startActivityForResult(chooser, REQ_CODE_UPI); | |
} else { | |
intent.setPackage(appPkg); | |
startActivityForResult(intent, REQ_CODE_UPI); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment