How to run an activity in the background in android, and it should show up if a message is recieved?
I have a requirment in my task that there is a activity that recieves a text sms and performs some functionality, i want that activity to sleep in the background until an sms is recieved, and when that sms is re开发者_如何学Gocieved it should pop up and perform the functionality
How can i make the application work and listen in the background in android?
How can i activate it upon reception of the message? and how to test it on emulator?
Regards,
Wasif
Look at this post on howto emulate, receive and handle SMS messages
Android API – SMS handling
You will need to implement it as a Service
.
精彩评论