package trantect.android_framework_demo.activity;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import trantect.android_framework_demo.R;

/**
 * Create by Trantect on 14-7-2.
 */
public class MainActivity extends Activity {

    private String getTag() {
        return getPackageName().toString() + getClass().toString();
    }

    @Override
    public void onCreate(Bundle savedInstance) {
        super.onCreate(savedInstance);
        Log.d(getTag(), "onCreate");
        setContentView(R.layout.welcome_main);
    }

    @Override
    public void onStart() {
        super.onStart();
    }
}

@@ -124,17 +124,104 @@
 il.Log;%0A
+import android.view.View;%0Aimport android.widget.Button;%0Aimport android.widget.TextView;
 %0A
-
 import t
@@ -358,99 +358,60 @@
 ate 
-String getTag() %7B%0A        return getPackageName().toString() + getClass().toString();%0A    %7D
+Button bt_welcome;%0A%0A    private TextView tv_welcome;
 %0A%0A  
@@ -594,16 +594,60 @@
 _main);%0A
+        initViews();%0A        onViewClick();%0A
     %7D%0A%0A 
@@ -699,22 +699,1263 @@
     
-super.onStart(
+Log.d(getTag(), %22onStart%22);%0A        super.onStart();%0A    %7D%0A%0A    private String getTag() %7B%0A        return getPackageName().toString() + getClass().toString();%0A    %7D%0A%0A    // init some views%0A    private void initViews()%7B%0A        bt_welcome = (Button)findViewById(R.id.bt_welcome);%0A        tv_welcome = (TextView)findViewById(R.id.tv_welcome);%0A        showBtView();%0A    %7D%0A%0A    private void onViewClick()%7B%0A        MyListener myListener = new MyListener();%0A        bt_welcome.setOnClickListener(myListener);%0A        tv_welcome.setOnClickListener(myListener);%0A    %7D%0A%0A    class MyListener implements View.OnClickListener%7B%0A%0A        @Override%0A        public void onClick(View view) %7B%0A            int id = view.getId();%0A            switch (id)%7B%0A                case R.id.bt_welcome:%0A                    showTvView();%0A                    break;%0A                case R.id.tv_welcome:%0A                    showBtView();%0A                    break;%0A            %7D%0A        %7D%0A    %7D%0A%0A    // show Button%0A    private void showBtView()%7B%0A        bt_welcome.setVisibility(View.VISIBLE);%0A        tv_welcome.setVisibility(View.GONE);%0A    %7D%0A%0A    // show TextView%0A    private void showTvView()%7B%0A        tv_welcome.setVisibility(View.VISIBLE);%0A        bt_welcome.setVisibility(View.GONE
 );%0A 

Add some logic on main activity