In Android, I have a notification and I want to send a message back to the activity (and use the message to control my app). What is the simplest method to do that with PendingIntent
? Is getBroadcast
the appropriate way? getActivity
opens the activity and I don't want to open it, but only tell it to do something.
您可以创建一个后台服务来接收PendingIntent.getService
发送的消息, 这是有关创建后台服务的官方指南
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.