views:

19

answers:

2

Greetings I am creating a service client and the following lines give me error. I was wondering how to fix these... // I have put in the service client stuff below... private CheckZone mBoundService; private ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName CheckZone, IBinder service) { // This is called when the connection with the service has been // established, giving us the service object we can use to // interact with the service. Because we have bound to a explicit // service that we know is running in our own process, we can // cast its IBinder to a concrete class and directly access it. mBoundService = ((CheckZone.LocalBinder)service).getService();

                   //This line complians about binding, and states that it can

not be resolved. How do I fix this please? Toast.makeText(binding.this, "Connected to CheckZone", Toast.LENGTH_SHORT).show(); }

A: 

I think you are referring to a compilation error? Binding is not defined? Just get rid of binding.this and just use, "this"

Greg
A: 

Do you have a LocalBinder in your CheckZone service?

Vladimir Ivanov