Android Change a variable in service from other app -


the title says all, need change variable of service activity in other app , finalize service or not, possible?

i found message object , not quite understand

the simplest solution implement broadcastreceiver. service listens broadcast , other app sends broadcast.

example reciever:

public class myreceiver extends broadcastreceiver {   @override   public void onreceive(context context, intent intent) {     // bundle intent , use set variable in service   } }  

example broadcaster (courtesy of vogella):

intent intent = new intent(); intent.setaction("de.vogella.android.mybroadcast"); sendbroadcast(intent);  

Comments

Popular posts from this blog

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

Python website log in: BIG-IP can not find session information in the request -