title: handler and service: multiple UI updates
body: <p>I need to start service in background, which can show custom Toast each interval of time, then I make service and in its thread I have made infinite while loop with sleep thread to make the interval.</p>
  
  <p>My problem that, in each time I have to show the super Toast I need to call the handler, which is okay, but the major problem that the Toast is shown only for one time! although there is infinite while loop condition!</p>
  
  <p><strong>the following is the Service : onStartCommand</strong></p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, int flags, int startId) {
  
      Log.i(TAG, "Service onStartCommand");
  
      new Thread(new Runnable() {
          @Override
          public void run() {
  
              Looper.prepare();
              mHandler = new Handler() {
                  public void handleMessage(Message msg) {
                      //Looper.myLooper().quit();
                      Random r = new Random();
                      int i1 = r.nextInt(items.size() - 0) + 0;
                      superToast.setBackground(SuperToast.Background.GREEN);
                      superToast.setAnimations(SuperToast.Animations.FLYIN);
                      superToast.setText(items.get(i1));
                      superToast.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
                      superToast.show();
                      Log.i("Handeler", "Handeler");
                  }
              };
  
              while (isRunning) {
                  Random r2 = new Random();
                  time = r2.nextInt(Max - Min) + Min;
                  mHandler.sendEmptyMessage(0);
                  try {
                      Thread.sleep(time);
                  } catch (InterruptedException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
                  if (isRunning) {
                      Log.i(TAG, "Service running");
                  }
                  Looper.loop();
              }
          }
      }).start();
  
      return Service.START_STICKY;
  }
  </code></pre>