I want to use app = (MyApplication)getApplication(); at BroadcastReceiver
app = (MyApplication)getApplication();
BroadcastReceiver
I use this link: http://www.devahead.com/blog/tag/application/
but getApplication does not go into BroadcastReceiver, how can I use it?
getApplication
I need this because I want to exchange data between two BroadcastReceiver
Your BroadcastReceiver has an onReceive(Context ctx, Intent intent) method onReceive(Context ctx, Intent intent) , which is called to receive the message ... you manually pass the context.
onReceive(Context ctx, Intent intent)