Intent from Broadcast receiver to an activity?
I have an app, that send SMS when button is clicked. After thet I am expecting a answer SMS, so it goes like this:
- Button click -> SMS is send (done)
- SMS reciver is listening for incoming SMS (done)
- After SMS is recived, Reciver is extracting Text from SMS and saves it to the text file on sdcard (done)
- After text is copied, i need to start new activity (not done)
So can i start new开发者_如何学Go activity from BroadcastReceiver
after recived SMS is proccessed?
from receiver you can start the activity like this:
Intent launch = new Intent(context, ActivityToLaunch.class);
launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(launch);
Answer is Yes. You can start an activity in your BroadcastReceiver
.
精彩评论