I am writing an android app that will send an SMS to a GSM module which will do something (what exactly is irrelevant).
This app will do stuff like choose whether some devices are going to be on or off.
The problem is that I want to make a button which will send an SMS with a question to a particular device. Then I want a notification to pop up (“Waiting for the device response”).
I want to keep this notification on the screen until I get an SMS reply.
How do I make the toast linger until the reply comes?
You don’t. Since the user cannot get rid of a
Toast, they have a limited lifetime, so the user will not get irritated with people cluttering up the screen for an indefinite period of time.Since you apparently have an activity (“I want to make a button”), you can display your message in your activity’s UI, or pop up a dialog.