목록Android (3)
hanker
Android - 다른 Activity를 생성하여 onClick 이벤트 처리 오류 (java.lang.IllegalStateException: Could not execute method for android:onClick 오류)
MainActivity외에 onClick 이벤트를 처리 할 Activity를 생성하여 실행 시켰더니 java.lang.IllegalStateException: Could not execute method for android:onClick 오류가 발생했다. 이유 : AndroidManifest.xml에 Activity 지정이 안되어서 나는 오류였다. 추가 후 오류 없음
Android
2021. 8. 5. 14:29
Android - URL 이동
@Override public void onClick(View v) { switch(v.getId()) { case R.id.btn1: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.hanke-r.tistory.com")); startActivity(intent); break; case R.id.btn2: ... } } App 화면에 버튼을 만들어 URL 이동을 하고 싶은 경우 Uri.parse("") 안에 이동하고싶은 URL 넣어서 startActivity 메서드 실행
Android
2021. 5. 10. 16:36