package com.gusfree.intent;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
public class IntentActivity extends Activity implements OnClickListener{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViewById(R.id.button1).setOnClickListener(this);
Log.i("onCreate","onCreate 시작");
}
@Override
public void onClick(View v) {
//에러찾을 때
Log.w("onClick","버튼을 눌렀다.");
//버튼 누르면 Sub로 Activity간 이동하기
Intent intent =new Intent();
Log.w("onClick","1");
intent.setClass(this, SubActivity.class);
Log.w("onClick","2");
startActivity(intent);//이동//error
Log.w("onClick","3");
}
}