【问题标题】:Intent filter for filtering payment sending apps用于过滤支付发送应用程序的意图过滤器
【发布时间】:2021-05-31 18:03:44
【问题描述】:

将用户发送到其他应用进行支付时,如何过滤支持支付的应用?

showPaymentSupportedApps();

button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {showPaymentSupportedApps(); } });

void showPaymentSupportedApps(){ // do some magic here }

谢谢..????

【问题讨论】:

    标签: android android-intent payment intentfilter google-pay


    【解决方案1】:

    我认为您不应该尝试自己过滤应用列表。相反,您应该让操作系统为您处理:https://developer.android.com/training/basics/intents/sending#no-app-available

    例子:

    // Build the intent.
    val location = Uri.parse("geo:0,0?q=1600+Amphitheatre+Parkway,+Mountain+View,+California")
    val mapIntent = Intent(Intent.ACTION_VIEW, location)
    
    // Try to invoke the intent.
    try {
        startActivity(mapIntent)
    } catch (e: ActivityNotFoundException) {
        // Define what your app should do if no activity can handle the intent.
    }
    

    【讨论】:

    • 感谢您的回答,但我希望列出支付应用程序而不是位置(地图)应用程序。 ?
    • 我不知道您指的支付应用程序。但请尝试查看您想要支持的支付应用程序是否有自己的 URI 方案。例如,印度的支付支持upi: URI 方案。
    猜你喜欢
    • 2014-12-20
    • 1970-01-01
    • 1970-01-01
    • 2015-10-23
    • 2012-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    相关资源
    最近更新 更多