Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26174] Android: add setCancelable method on Ti.UI.AlertDialog

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-07-20T16:12:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsandroid
ReporterMenno Juistdit
AssigneeYordan Banev
Created2018-06-30T13:06:31.000+0000
Updated2018-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
    });

Comments

  1. Sharif AbuDarda 2018-07-02

    Hello, Thanks for submitting the ticket. Our engineers will look into it.
  2. Yordan Banev 2018-07-02

    PR: https://github.com/appcelerator/titanium_mobile/pull/10146
  3. Samir Mohammed 2018-09-24

    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

JSON Source