Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

cancel button on activityIndicator ?

hi, is there a way to add a kind of cancel-button to the message label on a activity indicator (on android)? for example, if i indicate a search for geo coordinates, and it doesn't get something back from gps, it would be nice to cancel the operation. of course i could add a timeout-event, but…
thx, u.

— asked April 8th 2010 by u no
  • activityindicator
  • android
0 Comments

3 Answers

  • The back button would be the way to cancel on Android. That capability doesn't currently exist, but it could be added.

    — answered April 9th 2010 by Don Thorp
    permalink
    1 Comment
    • Would like to see this added. I tried adding an event listener:

      uxActivityIndicator = Ti.UI.createActivityIndicator({
          message: L('Searching')
      });
      win.addEventListener('android:back' function() {
          Ti.API.debug('backfired');
          uxActivityIndicator.hide();
      });
      uxActivityIndicator.addEventListener('android:back' function() {
          Ti.API.debug('backfired from indicator');
          uxActivityIndicator.hide();
      });
      

      doesn't work. Neither event fires using API 1.8.

      — commented February 9th 2012 by Eric Rushing
  • what I would do is create a custom view that had a timer and if in a reasonable time there was no response, I would notify the user and have them cancel or try again. just my .02…

    — answered April 8th 2010 by Clint Tredway
    permalink
    0 Comments
  • thanks clint, that's what i actually do. but i have seen activity indicator with a cancel button on android phones, so i know android supports it. that's why i asked. or i make it a feature request… –u

    — answered April 8th 2010 by u no
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.