안드로이드 개발 질문/답변
(글 수 45,052)
package project.com;
import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener;
public class MainSourse extends Activity implements OnClickListener
{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
View DeartmentListButton = findViewById(R.id.DeartmentList_Button);
DeartmentListButton.setOnClickListener(this);
View LectureButton = findViewById(R.id.Lecture_Button);
LectureButton.setOnClickListener(this);
}
public void onClick(View v) //클릭을 했을시
{
switch(v.getId())
{
case R.id.DeartmentList_Button: //DeartmentList_Button 버튼을 눌렀을때
Intent d = new Intent(this, DepartmentList.class); //DepartmentList 클래스의 인텐드를 가져온다
startActivity(d); //액티비티 시작
break;
case R.id.Lecture_Button: //Lecture_Button 버튼을 눌렀을때
Intent l = new Intent(this, Lecture.class); //Lecture 클래스의 인텐드를 가져온다
startActivity(l); //액티비티 시작
break;
}
}
}
제가 다니는 대학교의 정보를 학생들이 쉽게 접근하게 해주기 위한 앱을 만들고 있습니다.
그런데 화면전환이.. 지금 위의 소스에 나오는 메인소스 액티비티에서 버튼 첫번째거 누르면 departmentlist로 가야하는데.. 머.. 저거나,,
lucture나.. 둘다 화면전환, 액티비티 이동이 되질않습니다. 이상하게.. 딴거 만들때랑 비슷하게 갖출거 다 갖춰 넣었는데 안되는 이유가 먼지..
여러번 실행해서 버튼 클릭했지만 매번 Sorry! 경고창이 뜹니다. 제발 도와주세요.!!!
다른 게임만들때는 화면전환이 되던데.. 이건 왜인지;; 이상하게 안됩니다 ㅠㅠ




매니페스트에 액티비티 등록하셔나요?