Android Question How to Set Incoming Message in EditText When the application is Idle

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have SMS application using "SmsInterceptor".I have set the Incoming Message in EditText When receiving message.Is it possible to set "Incoming Message" in EditText when application is in Inactive ???

that means When I switch over other screen ,is it possible to set incoming message in EditText ??
 

DonManfred

Expert
Licensed User
Longtime User
If your app is in background then NO UI is visible at this time. Means that there is no active activity where you could change edittext. So the answer is no.

You can use your service to store the last one. When your app comes back in the foreground you can use the stored value from the service to show in your edittext.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Yep. Even WhatsApp does it that way. You could throw a notification instead. When the user clicks on it, you app starts again and you can show the data. You could even start the activity from a service but that is seen as a bad behaviour if an app suddenly "appears" aout of the blue.
 
Upvote 0
Top