Android Broadcast -
there question android4.2 broadcast,
android.intent.action.time_tick
android.intent.action.package_install
this 2 protected broadcast define in /frameworks/base/core/res/androidmanifest.xml
only find register receiver use context.registerrecriver(),
question:where send broadcast attached android.intent.action.time_tick
thanks
if declare in manifest file wont enough.manifest file blue print.you need declare broadcast receiver there , after u need register broadcast receiver in code here attaching sample broadcast receiver code.
batterylevelfilter= new intentfilter(intent.action_battery_changed); this.registerreceiver(batterylevelreceiver, batterylevelfilter); broadcastreceiver batterylevelreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { //yourcode } };
Comments
Post a Comment