java - Passing Custom Binder between packages -
how send custom binder object between android packages? service activity (in separate packages)? i've been playing while cannot seem work. custombinder contained in library both packages have copy of. the error @ casting point in onserviceconnected. see "casting failed". i've noticed bit more interesting things this. when override tostring method in custombinder, , make return string, , print out binder get, "android.os.binderproxy" instead. updated code reflect: package 1 (contains activity) private serviceconnection mconnection = new serviceconnection(){ @override public void onserviceconnected(componentname name, ibinder binder){ log.d("tag",binder.tostring()); try{ custombinder nbinder = (custombinder)binder; log.d("tag","it worked!"); }catch(exception e){ log.d("tag","casting failed again"); }...