[英]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:
之后,我希望收到一个SMS答复,所以它像这样:
So can i start new activity from BroadcastReceiver
after recived SMS is proccessed? 那么在收到短信后,我可以从
BroadcastReceiver
开始新的活动吗?
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
. 您可以在
BroadcastReceiver
启动活动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.