//Geocoding - 고유명칭(주소나 산,호수의 이름등)을 가지고 위도와 경도의 좌표값를 얻는 것
예외 처리
try{
resultList = geocoder.getFromLocation(getLatitude, getLongitude, 1)
}catch(e:IOException){
e.printStackTrace()
}
val hasCoarseLocationPermission = ContextCompat.checkSelfPermission(this, coarseLocationPermission)
checkSelfPermission - 앱 사용 권한 요청
해당권한의 기능사용 시 checkSelfPermission 을 사용하여 사용자가 권한을 승인해야만 API의 사용이 가능
안드로이드 - permission 퍼미션 요청 및 확인 후 넘어가기
https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=jogilsang&logNo=221513582664
requestPermissions
//액티비티를 넘어가기 전에 권한을 모두 허용하고 넘어가게 함.
ActivityCompat.requestPermissions(this, PERMISSION, PERMISSION_REQUEST_CODE)
'Android > Kotlin' 카테고리의 다른 글
Activity -> fragment 전환 (0) | 2021.08.04 |
---|---|
갱신 갱신 갱ㅇ신!!!!!!! (0) | 2021.08.02 |
fragment -> Activity / Activity -> fragment 데이터 전달 및 메소드 호출 (0) | 2021.07.30 |
Maven 설치할 때 오류 (0) | 2021.07.28 |
Fragment에서 뒤로가기 버튼 클릭시 프래그먼트 종료 (0) | 2021.07.25 |