안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요 현재 안드로이드개발을 배우고 있는 왕초보입니다.
현재 버튼을 클릭하면 연결한 클래스로 가도록 해야하는데
이클립스에서는 오류가 없는데 에뮬레이터에서는 "죄송합니다" 라는 메시지와 함께 팅겨버리네요..ㅜㅜ
밑에 소스구요 잘못된부분 지적부탁드립니다.
package com.layout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class layout extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ImageButton Image_button01 = (ImageButton) findViewById(R.id.ImageButton01);
Image_button01.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(layout.this, "Button clicked!!", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), layout01.class));
//timer.start();
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ImageButton Image_button01 = (ImageButton) findViewById(R.id.ImageButton01);
Image_button01.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(layout.this, "Button clicked!!", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), layout01.class));
//timer.start();
}
});
}
@Override
public boolean onTouchEvent(MotionEvent event) {
Toast.makeText(layout.this, "!!", Toast.LENGTH_SHORT).show();
return super.onTouchEvent(event);
}
}
public boolean onTouchEvent(MotionEvent event) {
Toast.makeText(layout.this, "!!", Toast.LENGTH_SHORT).show();
return super.onTouchEvent(event);
}
}
↑ ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ 위에적은것이 메인이구요
package com.layout;
import android.app.Activity;
import android.os.Bundle;
import android.os.Bundle;
public class layout01 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sub01);
}
}
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sub01);
}
}




Intent intent2 = new Intent(Select.this,Screen.class); startActivity(intent2); // Sub_Activity 호출