Android - Service variable access -
i implementing application in android needs access location object. running logistics object in object.
afterwards binding activity service, servicegps.java, service , location update seems works ok, problem cant not access location object inside servicegps.
the connection service defined update global variable in activity class
private serviceconnection mconnection = new serviceconnection() { @override public void onserviceconnected(componentname classname, ibinder service) { @suppresswarnings("unchecked") servicegps mservice = ((localbinder<servicegps>)service).getservice(); // hold of resource, db etc , pass through object use mlocationmanager = mservice.getmlocation(); } @override public void onservicedisconnected(componentname arg0) { // todo auto-generated method stub } };
if debug code, mlocationmanager recibes correct values. want access mservice.getmlocation() in activity, cant.
as cant declare mservice class member.
any suggestions?
thanks lot priceless help.
br, david.
this might you're looking android: access variables passed service
Comments
Post a Comment