protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu_activity2);
ImageButton image01 = (ImageButton) findViewById(R.id.t1);
ImageButton image02 = (ImageButton) findViewById(R.id.t2);
ImageButton image03 = (ImageButton) findViewById(R.id.t3);
ImageButton image04 = (ImageButton) findViewById(R.id.t4);
image01.setOnClickListener(this);
image02.setOnClickListener(this);
image03.setOnClickListener(this);
image04.setOnClickListener(this);
}
.
.
.
.
public void onClick(View v) {
// TODO Auto-generated method stub
if(v != null){
Intent myIntent = new Intent(getApplicationContext(), CameraActivity2.class);
startActivity(myIntent);
}
else
return;
}
각각 다른 버튼인데
클릭했을 때 같은 명령으로 하고 싶어요!
이렇게 했는데 첫번째만 실행이 되고 나머지는 안먹히더라구요.