getApplication in BroadcastReceiver in 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
你的BroadcastReceiver
有一个onReceive(Context ctx, Intent intent)
方法,它被调用来接收消息......你正在交付一个上下文。
上一篇: 对于WORD,cmpxchg比BYTE快