[TIMOB-26174] Android: add setCancelable method on Ti.UI.AlertDialog
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-07-20T16:12:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | Android |
Labels | android |
Reporter | Menno Juistdit |
Assignee | Yordan Banev |
Created | 2018-06-30T13:06:31.000+0000 |
Updated | 2018-09-24T10:32:02.000+0000 |
Description
When I use the following code, I want to prevent the Android back button from dismissing the dialog, since I want to detect if a user clicked or canceled the dialog. When the dialog is canceled/dismissed via the Android back button, no event is triggered.
By implementing the setCancelable method, this could be solved. See https://developer.android.com/reference/android/app/AlertDialog.Builder#setCancelable(boolean)
var dialog = Ti.UI.createAlertDialog({
message: pMessage,
ok: 'OK',
title: 'Title',
canceledOnTouchOutside: false,
persistent: true
});
Hello, Thanks for submitting the ticket. Our engineers will look into it.
PR: https://github.com/appcelerator/titanium_mobile/pull/10146
Closing ticket. Improvement can be seen in SDK version 7.5.0.v20180920040518. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10146