hanker
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' 카테고리의 다른 글
Android - 다른 Activity를 생성하여 onClick 이벤트 처리 오류 (java.lang.IllegalStateException: Could not execute method for android:onClick 오류) (0) | 2021.08.05 |
---|---|
Android Studio - github 프로젝트 불러오기 (0) | 2021.04.26 |