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
Post a Comment