title: how to make toast from another thread (sans runOnUiThread)
body: <p>I need to make an Android toast from a processing thread, which is custom for OpenCV so I can't use runOnUiThread() as suggested here:
  <a href="https://stackoverflow.com/questions/3134683/android-toast-in-a-thread">Android: Toast in a thread</a>.</p>
  
  <p>Most of this code is from the CVCamera sample app. But those unfamiliar, when I select the Surf menu button, the SURFProcessor is called like so:</p>
  
  <pre><code>           else if (item.getTitle().equals("SURF")) {
  
                     defaultcallbackstack.addFirst(new SURFProcessor());
                     toasts(DIALOG_TUTORIAL_SURF, "");
  
             }
  </code></pre>
  
  <p>This Processor thread is run so that when I press the phone's camera button (capturePress = true), an image is taken and processing done. I want to call toasts method as shown:</p>
  
  <pre><code>class SURFProcessor implements NativeProcessor.PoolCallback {
  
             @Override
             public void process(int idx, image_pool pool, long timestamp,
                             NativeProcessor nativeProcessor) {
                     if(capturePress) {
                             String processMsg = processor.processFeatures(idx, pool, cvcamera.DETECT_SURF);
                             capturePress = false;
                             toasts(PROCESS_MESSAGE, processMsg);
                     }
             }
  }
  </code></pre>
  
  <p>Here is the toasts method, located in the main class extending Activity:</p>
  
  <pre><code>void toasts(int id, String msg) {
             switch (id) {
             case PROCESS_MESSAGE:
                     Toast.makeText(MMRapp.this, msg, Toast.LENGTH_LONG).show();
                     break;
  .........
  </code></pre>
  
  <p>Right now this code gives me an error: "can't create handler inside thread that has not called Looper.prepare()." How do I go about calling the toasts method? Or is it possible to have the toasts method listen for a change in processMsg? If possible, I can get by with sending the processMsg or changing a class variable instead. In essence, I need a String updated from this Processor thread.  </p>
  
  <p>Thank you very much, and I will provide more info/code if wanted.<br>
  -Tom</p>