button_5.setOnClickListener {
var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.naver.com"))
startActivity(intent)
}
출처 : https://hjp845.tistory.com/37
[안드로이드 스튜디오][코틀린] 특정 사이트 링크로 이동하기 [android][kotlin]
버튼을 눌렀을 때, 어떤 사이트로 이동하게 만드는 코드이다. button_5.setOnClickListener { var intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://library.dgist.ac.kr/site/dgist_library/menu/839.do"..
hjp845.tistory.com
'프로그래밍 > Kotlin' 카테고리의 다른 글
[Kotlin] Naver API를 이용해 책 검색 코드 (0) | 2022.07.20 |
---|---|
[Kotlin] 코루틴 디스패처 (0) | 2022.07.05 |
[Kotlin] EditText 코드로 열기 (XML사용 X) (0) | 2022.04.20 |
[Kotlin] 모델로 가져온 Spinner값 표시 (0) | 2022.03.21 |
[Kotlin] 안전하게 특정 클래스로 Type Casting 하는법 (0) | 2022.03.16 |
댓글