FileDocCategorySizeDatePackage
RemoteServiceBinding.javaAPI DocAndroid 1.5 API9794Wed May 06 22:41:08 BST 2009com.example.android.apis.app

RemoteServiceBinding

public class RemoteServiceBinding extends android.app.Activity

Fields Summary
IRemoteService
mService
The primary interface we will be calling on the service.
ISecondary
mSecondaryService
Another interface we use on the service.
android.widget.Button
mKillButton
android.widget.TextView
mCallbackText
private boolean
mIsBound
private android.content.ServiceConnection
mConnection
Class for interacting with the main interface of the service.
private android.content.ServiceConnection
mSecondaryConnection
Class for interacting with the secondary interface of the service.
private android.view.View.OnClickListener
mBindListener
private android.view.View.OnClickListener
mUnbindListener
private android.view.View.OnClickListener
mKillListener
private IRemoteServiceCallback
mCallback
This implementation is used to receive callbacks from the remote service.
private static final int
BUMP_MSG
private android.os.Handler
mHandler
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)
Standard initialization of this activity. Set up the UI, then wait for the user to poke it before doing anything.


                              
    
        
        super.onCreate(savedInstanceState);

        setContentView(R.layout.remote_service_binding);

        // Watch for button clicks.
        Button button = (Button)findViewById(R.id.bind);
        button.setOnClickListener(mBindListener);
        button = (Button)findViewById(R.id.unbind);
        button.setOnClickListener(mUnbindListener);
        mKillButton = (Button)findViewById(R.id.kill);
        mKillButton.setOnClickListener(mKillListener);
        mKillButton.setEnabled(false);
        
        mCallbackText = (TextView)findViewById(R.id.callback);
        mCallbackText.setText("Not attached.");