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

Android: Cannot re-show "ProgressIndicator" dialog if auto-hidden by closed window

    Details

    • Story Points:
      5
    • Sprint:
      2019 Sprint 17

      Description

      Summary:
      If a Ti.UI.Android.ProgressIndicator dialog was auto-closed by a window (ie: you did not call its hide() method yourself), then you will not be able to re-show the dialog ever again. The ProgressIndicator object becomes unusable.

      Note:
      This is more likely to happen if Android developer option "Don't keep activities" is enabled.

      Steps to reproduce:

      1. Build and run the below code on Android.
      2. Tap on the "Show Progress Dialog" button.
      3. A new window displaying a progress dialog will be shown.
      4. Wait 2 second for the window and dialog to auto-close.
      5. Tap on the "Show Progress Dialog" button again.
      6. Notice that the child window is empty. The progress dialog was not shown. (This is the bug.)

      var progressIndicator = Ti.UI.Android.createProgressIndicator({
      	message: "Progressing...",
      	location: Ti.UI.Android.PROGRESS_INDICATOR_DIALOG,
      	type: Ti.UI.Android.PROGRESS_INDICATOR_INDETERMINANT,
      });
       
      var window = Ti.UI.createWindow();
      var button = Ti.UI.createButton({ title: "Show Progress Dialog" });
      button.addEventListener("click", function(e) {
      	var childWindow = Ti.UI.createWindow({ title: "Child Window" });
      	childWindow.addEventListener("open", function() {
      		progressIndicator.show();
      		setTimeout(function() {
      			childWindow.close();
      		}, 2000);
      	});
      	childWindow.open();
      });
      window.add(button);
      window.open();
      

      Work-Around:
      Hide the progress dialog when via its window's "close" event.

      window.addEventListener("close", function() {
      	progressIndicator.hide();
      });
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Satyam Sekhri
            • Watchers:
              3 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