Issue with touch event: I want to show an alert, but the app closes immediately

Hi, its me again

I’m developing an app in MIT App Inventor called Snark, your passive-aggressive pet. I have implemented a function to count how many times the user touches Snark. The idea is that if the player touches Snark more than 20 times, an alert message should appear saying:

"It seems you’ve angered Snark too much, you lost."

However, instead of showing the alert, the app closes immediately right after Snark shows that it’s angry.

Here’s a summary of how I set it up:

  • I use a global variable ToquesSnark to count the touches.
  • When ToquesSnark > 20, Snark shows an angry phrase.
  • After that, I want to show a Notifier.ShowAlert with the message.
  • But instead, the screen closes without showing anything.

Does anyone know why this might be happening? Could it be a logic issue in the event, or maybe an error in how I’m handling screens or timers?

Thanks in advance for any help or suggestions!

Snark_tumascotapasivoagresiva_1 (1).aia (747.7 KB)

But you designed your code like that only know? When the count goes or touches 20 clock timers, when clock timers an notifier alert then app closes. Now i removed the close app

Before notifer awake close application triggers and closed. You move the alert into when the count crosses the 20 logic, then before the clock timers notifier alert and set the time gap to 2000 ms so user may see it properly

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.