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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -