title: Custom Toast Cancel not working
body: <p>I have seen a number of questions on cancelling toast. None of them is working. </p>
  
  <p>I have a custom Toast. The code for that is all but one line same as <a href="http://developer.android.com/guide/topics/ui/notifiers/toasts.html#CustomToastView" rel="noreferrer">http://developer.android.com/guide/topics/ui/notifiers/toasts.html#CustomToastView</a></p>
  
  <p>The difference is as follows. </p>
  
  <ol>
  <li>The toast variable is defined as a class variable</li>
  <li>The entire java code is written in a method. </li>
  <li><p>In the start of this method, I have added the following line to cancel the toast. </p>
  
  <pre><code>if (toast!=null){
      toast.cancel();
  }
  </code></pre></li>
  </ol>
  
  <p>The method is called when user selects (onClick) the view/layout. The issue is when the user selects few times, the toast will get queued up (the toast.cancel is not working). </p>
  
  <p>Any solutions?</p>
  
  <p>[update]
  I tried making toast object a static variable. Still dont work.</p>