Button has stopped doing anything when clicked?

Hello New guy here. I have been playing with App Inventor off and on for 2 or three years and am currently working on an app that I have had in mind for literally years.

Given the following "Code"

Can anyone see why the button "when clicked" does absolutely nothing?? It does not even display the "Button clicked comment.

Works the same way as an APK and connected to the companion.

ANy and all comments greatly appreciated.

Deactivate the TouchUp event as test and check, if it works then
Taifun

Just tried it Same thing. The Button blinks once then the program freezes up without ever displaying the initial progress comment.

What happens in your ProgressMessageDisplay procedure? Please provide a screenshot

This might be a good read for yoi

Taifun

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.

export_and_upload_aia

.

Attached Upload is the .aia file for the App I am working on wherein the Tap to arm Timer and GPS button has stopped working entirely. As you will see the only thing it is currently supposed to do is Print a Msg in TestLabel4. In the compiled .APK the button does nothing and after a few moments I get a Msg that the APP is not responding. Can anyone see the reason for this??
Veh_Perf_AnalyzerF_Screen_checkpoint3.aia (265.5 KB)

image

Your Project does not load cleanly onto he code server.

These should be avoided because they freeze the app:

Use Clock Timers instead.

This while loop is also fatal:


The variables in question will never change within that firing of the event.

1 Like

Dear @Eldon_Beix,
please be aware that the "while test", that @ABG has already highlighted, will never exit because the variable speed:


will never be updated. This is due to the fact that Appinventor is a "single thread" type of code, therefore external events (like the GPS updating) will never be in degree to interrupt the while execution.
If you want to allow background tasks to run while the foreground app is in execution, you shall use the Itoo extension (by @Kumaraswamy). In your case you shall allocate the GPS task in background, and share with the foreground the related variables (by using the store/fetch properties).
I've published some time ago, an example that can give you some idea, about:
https://community.appinventor.mit.edu/t/multithread-delay-flow-interruption-by-means-of-itoo/114233/9
Or, much easier, you can use the clocks, as @ABG has said, to run periodically the GPS tasks and avoid the use of the "while test".
Best wishes.

That's the way to go

To get locations in the background you need background location permission, which is not possible with itoo itself

Taifun

1 Like

Apparently that is related to the issues I am having with a non functional button. I believe my only recourse is to start from a clean slate and rebuild the app.

Figured it out. problem was in the designer screen. Apparently the Tap button was some how corrupted. I deleted it and reinstalled it and now everything appears to be working.