package com.hide.ServiceTest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ServiceTestActivity extends Activity {
	  Button startButton;
	  Button stopButton;
	  Button startButton2;
	  Button closeButton;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        findViews();

        startButton.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {
            	startService(new Intent(getBaseContext(), MyService.class));
            }
        });

        stopButton.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {
              stopService(new Intent(getBaseContext(),MyService.class));
            }
        });

        startButton2.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {
            	startService(new Intent(getBaseContext(), MyService2.class));
            }
        });

        closeButton.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {
              stopService(new Intent(getBaseContext(),MyService.class));
              finish();
            }
        });
    }
    protected void findViews(){
        startButton = (Button)findViewById(R.id.start_button);
        stopButton = (Button)findViewById(R.id.stop_button);
        startButton2 = (Button)findViewById(R.id.start_button2);
        closeButton = (Button)findViewById(R.id.close_button);
    }
}