package com.dagaz.evgeny.p0102_activitylistener;

import android.app.Activity;
import android.content.DialogInterface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements View.OnClickListener {
    TextView tvView;
    Button btnOK;
    Button btnCancel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tvView = (TextView) findViewById(R.id.tvView);
        btnOK = (Button) findViewById(R.id.btnOK);
        btnCancel = (Button) findViewById(R.id.Cancel);
//
        btnOK.setOnClickListener(this);
        btnCancel.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btnOK:
                tvView.setText("This is OK");
                break;
            case R.id.Cancel:
                tvView.setText("This is Cancel");
                break;
        }

    }
}

@@ -187,16 +187,41 @@
 Bundle;%0A
+import android.util.Log;%0A
 import a
@@ -438,16 +438,63 @@
 nCancel;
+%0A    private static final String TAG = %22p0102%22;
 %0A%0A    @O
@@ -1053,24 +1053,66 @@
 is is OK%22);%0A
+                Log.d(TAG, %22This is OK%22);%0A
             
@@ -1198,24 +1198,70 @@
 s Cancel%22);%0A
+                Log.d(TAG, %22This is Cancel%22);%0A
             

Add log