I want to implement pendingIntent.getbroadcast and pendingIntent.getactivity at same time. Actually my application is sending the notification When user Click on my notification my Application will start(by using getActivity) and It also broadcast to my broadcast receiver to perform some activity by my broad cast receiver. Thanks in advance
You can either:
Use a getBroadcast()
PendingIntent
and have the BroadcastReceiver
call startActivity()
to start the activity, or
Use a getActivity()
PendingIntent
and have the Activity
call sendBroadcast()
to send the broadcast
If the activity will be used for things other than this Notification
, the first solution is probably easier to implement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With