package huyifei.mymvp.service;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import huyifei.mymvp.R;

public class ServiceActivity extends AppCompatActivity {
    private Context mContext;
    private Intent mIntent;
    //
    private MyServiceConnectin connection;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        setContentView(R.layout.activity_service);
        mIntent = new Intent(mContext, MyService.class);
        //
        connection = new MyServiceConnectin();
        actionView();


    }

    private void actionView() {
        findViewById(R.id.startService).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startService(mIntent);
            }
        });

        findViewById(R.id.stopService).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                stopService(mIntent);
            }
        });
        findViewById(R.id.bindService).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bindService(mIntent, connection, BIND_AUTO_CREATE);
            }
        });

        findViewById(R.id.unbindService).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                unbindService(connection);
            }
        });

        findViewById(R.id.intentService).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MyIntentService.startActionBaz(mContext, "Hello ", "Baz");
            }
        });
    }
}

@@ -381,16 +381,130 @@
 ction;%0A%0A
+    /**%0A     *  %5BService %E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%5D(%22http://www.jianshu.com/p/8d0cde35eb10%22)%0A     * @param savedInstanceState%0A     */%0A%0A
     @Ove

add some info