Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23486

Android: Add an option to handle AlertDialog box outside touch.

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.0.0
    • Component/s: Android
    • Labels:
    • Story Points:
      2
    • Sprint:
      2016 Sprint 12 SDK

      Description

      Overview:

      In android, when I click outside the AlertDialog, AlertDialog box will close. I need to close AlertDialog only when I click on cancel button in AlertDialog.
      https://developer.android.com/reference/android/app/Dialog.html#setCanceledOnTouchOutside(boolean)

      steps to reproduce

      1. Just create a sample project
      2. Paste the following code
      3. Run it on device and click the button
      4. Then touch outside the dialog
      5. It dismisses, the customer wants to prevent that

      Test Code

      app.js

      var win = Ti.UI.createWindow({
       
      });
       
      var alertDialog = Ti.UI.createButton({
      	title : 'ShowDialog',
      	height : Ti.UI.SIZE,
      	width : Ti.UI.SIZE,
       
      });
       
      // Listen for click events.
      alertDialog.addEventListener('click', function() {
      	var dialog = Ti.UI.createAlertDialog({
      		message : 'The file has been deleted',
      		cancel : 1,
      		buttonNames : ['Confirm', 'Cancel'],
      		message : 'Would you like to delete the file?',
      		title : 'Delete'
       
      	});
      	dialog.show();
      });
       
      // Add to the parent view.
      win.add(alertDialog);
       
      win.open();
      
      

      Thanks

        Attachments

          Activity

            People

            • Assignee:
              msamah Ashraf Abu (Inactive)
              Reporter:
              jnaher Jebun Naher
              Reviewer:
              Hieu Pham
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code