Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add custom dialog on onBackButton if customBrowserConfig.setDisableBackButtonDialog(true) set true #45

Open
kedia1307 opened this issue Jul 23, 2020 · 0 comments

Comments

@kedia1307
Copy link

kedia1307 commented Jul 23, 2020

I am trying very hard to add my app's custom dialog if a user presses the back button from CBActivity.
As per your document
onBackButton(AlertDialog.Builder alertDialogBuilder) - This callback provides alert dialog access, so customisation can be done to alert dialog.
But In your CBActivityI can find that you are finishing activity if customBrowserConfig.setDisableBackButtonDialog(true) is set true. whic ofcourse finishes the activity and I am not able to add my custom dialog.
Please help.

It should work fine if you remove finish from your CBActivity.
//following code is from CBActivity(unEditable)
@OverRide
public void onBackPressed() {
if (customBrowserConfig != null && customBrowserConfig.getDisableBackButtonDialog() != 1) {
payUCustomBrowser.addEventAnalytics(CBAnalyticsConstant.USER_INPUT, CBAnalyticsConstant.PAYU_BACK_BUTTON_CLICK.toLowerCase());
payUCustomBrowser.showBackButtonDialog();
} else {
payUCustomBrowser.addEventAnalytics(CBAnalyticsConstant.USER_INPUT, CBAnalyticsConstant.MERCHANT_BACK_BUTTON_CLICK);
if (CustomBrowserData.SINGLETON.getPayuCustomBrowserCallback() != null)
CustomBrowserData.SINGLETON.getPayuCustomBrowserCallback().onBackButton(null);
CBActivity.this.finish();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant