Android 无法使用UPI URI调用PSP应用程序
首先- 我知道有一个类似的问题已经得到了回答。然而,答案对我没有帮助 我的问题是一样的- 使用UPI url,如下所示Android 无法使用UPI URI调用PSP应用程序,android,android-intent,payment,upi,Android,Android Intent,Payment,Upi,首先- 我知道有一个类似的问题已经得到了回答。然而,答案对我没有帮助 我的问题是一样的- 使用UPI url,如下所示 String UPI = "upi://pay?pa=xsas@hdfcbank&pn=ABC+DEF&mc=qy67vt&tr=12121&tn=your+order+with+us&am=1.5&url=shopify.com"; Intent intent = new Intent(); inten
String UPI = "upi://pay?pa=xsas@hdfcbank&pn=ABC+DEF&mc=qy67vt&tr=12121&tn=your+order+with+us&am=1.5&url=shopify.com";
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setData(Uri.parse(UPI));
Intent chooser = Intent.createChooser(intent, "Pay with...");
startActivityForResult(chooser, 1, null);
在我使用setData的那一刻,我就停止获取可以与之共享的应用程序列表(列表为空)。如果我删除setData,应用程序(短信、电子邮件等)的常规列表就会弹出,银行应用程序(接受UPI,比如ICICI/HDFC)就不在其中
这里可能出现什么问题?,替换此:
String UPI = "upi://pay?pa=xsas@hdfcbank&pn=ABC+DEF&mc=qy67vt&tr=12121&tn=your+order+with+us&am=1.5&url=shopify.com";
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setData(Uri.parse(UPI));
Intent chooser = Intent.createChooser(intent, "Pay with...");
startActivityForResult(chooser, 1, null);
为此:
String UPI = "upi://pay?pa=xsas@hdfcbank&pn=ABC+DEF&mc=qy67vt&tr=12121&tn=your+order+with+us&am=1.5&url=shopify.com";
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW); // this line needs to be updated
intent.setData(Uri.parse(UPI));
Intent chooser = Intent.createChooser(intent, "Pay with...");
startActivityForResult(chooser, 1, null);
这是因为对于所有要处理传入意图的deeplinked upi应用程序,需要使用View Action调用它们 替换这个:
String UPI = "upi://pay?pa=xsas@hdfcbank&pn=ABC+DEF&mc=qy67vt&tr=12121&tn=your+order+with+us&am=1.5&url=shopify.com";
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.setData(Uri.parse(UPI));
Intent chooser = Intent.createChooser(intent, "Pay with...");
startActivityForResult(chooser, 1, null);
为此:
String UPI = "upi://pay?pa=xsas@hdfcbank&pn=ABC+DEF&mc=qy67vt&tr=12121&tn=your+order+with+us&am=1.5&url=shopify.com";
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW); // this line needs to be updated
intent.setData(Uri.parse(UPI));
Intent chooser = Intent.createChooser(intent, "Pay with...");
startActivityForResult(chooser, 1, null);
这是因为对于所有要处理传入意图的deeplinked upi应用程序,需要使用View Action调用它们 您可以省略
intent.setAction(intent.ACTION\u SEND)代码>脱离您的意图,因为这不是强制性的,不同的应用程序将处理不同的操作
正如您在原始问题中所看到的,没有setAction
您可以省略intent.setAction(intent.ACTION\u SEND)代码>脱离您的意图,因为这不是强制性的,不同的应用程序将处理不同的操作
正如您在提到的原始问题中所看到的,没有setAction
此更新也不起作用。intent.setAction(intent.ACTION\u视图);另外,我在使用ICICIT的“口袋”应用程序时收到未定义的响应。此更新也不起作用。intent.setAction(intent.ACTION\u视图);另外,我在使用icicidid的“口袋”应用程序时收到未定义的响应。你找到了解决方案吗?你找到了解决方案吗?