Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getApplication in BroadcastReceiver in android

Tags:

android

I want to use app = (MyApplication)getApplication(); in BroadcastReceiver

i am using thi link: http://www.devahead.com/blog/tag/application/

but getApplication not exits in BroadcastReceiver, How can i use it?

I need it becouse i want to share data between two BroadcastReceiver

like image 211
senzacionale Avatar asked May 30 '26 23:05

senzacionale


1 Answers

Your BroadcastReceiver has an onReceive(Context ctx, Intent intent) method which is called to receive a message... you're being hand-delivered a context.

like image 71
mah Avatar answered Jun 02 '26 12:06

mah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!