title: Toast get displayed more than once
body: <p>I'm working on a QR reader app for Android. The main point of the app is to read QR codes using the phone camera. If the user is not working with the app the camera gets stopped after a certain time (using a <code>Timer</code> for this) to prevent battery consumption and making vibrate the phone, displaying a toast with a message indicating the user to push a button to reactivate the camera and then continue with his job.</p>
  
  <p>The problem is that when the event gets fired for the first time everything works as I was expecting but if it gets fired for a second time the Toast will be displayed twice, and so on if the event gets fired for an N number of times.</p>
  
  <p>The logic behind this workaround is here:</p>
  
  <p>Button logic that "resumes" the camera functionallity:</p>
  
  <pre><code>btnEncenderCamara.Click += (sender, e) =&gt; {
              camara.Start(lectorQR.Holder);
              btnEncenderCamara.Enabled = false;
              timerToDisableCamera.Interval = 6000;
              timerToDisableCamera.Elapsed += new ElapsedEventHandler(timerElapsed);
              timerToDisableCamera.Start();
          };
  </code></pre>
  
  <p>and the timer's event logic here:</p>
  
  <pre><code>protected void timerElapsed(object sender, ElapsedEventArgs e) {
          try
          {
              timerToDisableCamera.Stop();
              RunOnUiThread(() =&gt; {
                  Vibrator vibrator = (Vibrator)GetSystemService(Context.VibratorService);
                  vibrator.Vibrate(1000);
                  camara.Stop();
                  btnEncenderCamara.Enabled = true;
                  Toast.MakeText(this, "La cámara se ha detenido para ahorrar en cosumo de batería. Presione 'ENCENDER CÁMARA' para encender la cámara nuevamente", ToastLength.Short).Show();
              });
          }
          catch (Exception ex)
          {
  
              throw;
          }
      }
  </code></pre>
  
  <p>I need to find how I can avoid the Toast to get displayed more than once, once the event that stops the camera gets fired.</p>