title: looper.prepare question
body: <p>i am trying to loop a toast inside a timer but the toast doesn't show</p>
  
  <p>the log in logcat shows that cannot create handler inside thread that has not called looper.prepare() i am not sure what it means</p>
  
  <pre><code>    int initialDelay = 10000;
      int period = 10000;
      final Context context = getApplicationContext();
      TimerTask task = new TimerTask() 
      {
          public void run() 
          {               
              try
              {
                  if (a != "")
                  {   
                        Toast toast = Toast.makeText(context, "Alert Deleted!", Toast.LENGTH_SHORT);
                        toast.show();
                  }
              }
              catch (Exception e)
              {
  
              }
          }
      };
      timer.scheduleAtFixedRate(task, initialDelay, period);
  </code></pre>
  
  <p>what my application does is that every 10 sec it would check if a certain variable is empty. if it is empty then it will show a toast.</p>
  
  <p>i have no problem doing this in a service class but when i try to implement this into </p>
  
  <pre><code> public void onCreate(Bundle savedInstanceState)
  </code></pre>
  
  <p>i get this error</p>