Application scenarios that inherit the binder class to bind a service: the service is for your own use only (not third-partyProgramDevelopment ).
Note: This method is only applicable when the client and service are in the same program and process.
Implementation Method:
1. Create a binder instance in service:
This instance contains public methods that can be called by the client;
This instance returns the current service object (this service instance contains public methods that can be called by the client)
This instance returns a class object in the service class, which contains the public methods that can be called by the client.
2. Return the binder instance in the onbind function of the service.
3. Obtain the binder instance in the onserviceconnected method of the client, and call the public method of the service through the binder instance.
Demo go to http://pan.baidu.com/share/link? Consumer id = 582094 & UK = 2953765628