- I am using chrome custom tabs to integrate a payment gateway inside an Android App. Inside the payment gateway I have have to provide
payment_success_redirect
url andpayment_fail_redirect
for fail. - 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.
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();
}