android.intent.action.MAIN
get all background notification message on your current Activity
in your background service.java
Intent i = new Intent("android.intent.action.MAIN"); i.putExtra("isNet", true); context.sendBroadcast(i);
in your Activity where you want data
declare-----
private BroadcastReceiver mReceiver;try { this.unregisterReceiver(this.mReceiver); } catch (Exception ex) { }
mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { //-----------here you get data from intent } }; this.registerReceiver(mReceiver, new IntentFilter("android.intent.action.MAIN"));
Nice article!thanks for sharing such great post with us. i studied all your information and it is really good.
ReplyDeleteAndroid Training in Chennai
Android Training in Velachery
JAVA Training in Chennai
Python Training in Chennai
Big data training in chennai
Selenium Training in Chennai
Android Training in Chennai
Android Training in Tambaram
It was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteAndroid Training Institute in Chennai | Android Training Institute in anna nagar | Android Training Institute in omr | Android Training Institute in porur | Android Training Institute in tambaram | Android Training Institute in velachery