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

LocalServiceController

public class LocalServiceController extends android.app.Activity

Example of explicitly starting and stopping the {@link LocalService}. This demonstrates the implementation of a service that runs in the same process as the rest of the application, which is explicitly started and stopped as desired.

Fields Summary
private android.view.View.OnClickListener
mStartListener
private android.view.View.OnClickListener
mStopListener
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        setContentView(R.layout.local_service_controller);

        // Watch for button clicks.
        Button button = (Button)findViewById(R.id.start);
        button.setOnClickListener(mStartListener);
        button = (Button)findViewById(R.id.stop);
        button.setOnClickListener(mStopListener);