简体   繁体   English

Android chrome 自定义选项卡 backstack 问题

[英]Android chrome custom tabs backstack problem

  • I am using chrome custom tabs to integrate a payment gateway inside an Android App.我正在使用 chrome 自定义选项卡将支付网关集成到 Android 应用程序中。 Inside the payment gateway I have have to provide payment_success_redirect url and payment_fail_redirect for fail.在支付网关内,我必须为失败提供payment_success_redirect url 和payment_fail_redirect
  • Problem here is that whether payment succeeded or failed user is redirected to the given page.这里的问题是支付成功还是失败的用户都被重定向到给定的页面。 Now if user presses hardware back button previous page starts loading and I do not want this.现在,如果用户按下硬件后退按钮上一页开始加载,我不想要这个。
  • Is there a way to prevent this or know explicitly on which URL currently I am on.有没有办法防止这种情况或明确知道我目前在哪个 URL 上。

My Code:我的代码:

    try {
        CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
        CustomTabsIntent customTabsIntent = builder.build();
        customTabsIntent.intent.setData(Uri.parse(url));
        startActivityForResult(customTabsIntent.intent, CHROME_CUSTOM_TAB_REQUEST_CODE);
    } catch (Exception e) {
        e.printStackTrace();
    }

The API of Custom Tab component do not let the host app retrieve on which URL the user is right now, for privacy matters.出于隐私问题,自定义选项卡组件的 API 不允许主机应用程序检索用户现在所在的 URL。

You can monitor only some navigation events as described here .您只能监控一些导航事件描述这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM