Titanium - Why does my code crash in the success callback?

The successCallback is called in the engine thread. You have to switch to the main thread for any UI specific operations like removing the scanner from the view hierarchy etc. The easiest way of doing this is by using setTimeout:

picker.setSuccessCallback(function(e) {
      setTimeout(function() {
         // Code that manipulates the UI.
      }, 1);

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request