안드로이드 개발 질문/답변
(글 수 45,052)
일번 단추를 클릭하면 1번화면이 나오고
이번 단추를 클릭하면 2번화면이 나오게 할려고 하는데요
일번 단추를 클릭해도 1번이 나오고
이번 단추를 클릭해도 1번이 나옵니다
근데 일번 단추를 주석처리하고
실행해보면 이번 단추를 클릭하면 2번화면이 나오는데 말이죠,,
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId())
{
case R.id.sina:
intent = new Intent(AndroidFirst.this, sub.class);
startActivity(intent);
finish();
case R.id.sinb:
intent = new Intent(AndroidFirst.this, sinb.class);
startActivity(intent);
finish();
}}
주석처리한부분은 위에 case경우를 주석했을때 말하는거고요..
어떡게 해야대나요?
이번 단추를 클릭하면 2번화면이 나오게 할려고 하는데요
일번 단추를 클릭해도 1번이 나오고
이번 단추를 클릭해도 1번이 나옵니다
근데 일번 단추를 주석처리하고
실행해보면 이번 단추를 클릭하면 2번화면이 나오는데 말이죠,,
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId())
{
case R.id.sina:
intent = new Intent(AndroidFirst.this, sub.class);
startActivity(intent);
finish();
case R.id.sinb:
intent = new Intent(AndroidFirst.this, sinb.class);
startActivity(intent);
finish();
}}
주석처리한부분은 위에 case경우를 주석했을때 말하는거고요..
어떡게 해야대나요?




berak;문이 없는데요.