Last active
August 11, 2020 01:55
-
-
Save snowpero/a22dc21bea9d7ee127a10c647ff17d29 to your computer and use it in GitHub Desktop.
길찾기 관련 Map Intent 정리
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val desLng = 126.978390 | |
val desLat = 37.303638 | |
val title = "목적" | |
// 구글맵 길찾기 | |
private fun findGoogleMap() { | |
Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=$desLat, $desLng&title=$title")).apply { | |
`package` = "com.google.android.apps.maps" | |
}.let { | |
startActivity(it) | |
} | |
} | |
// 네이버지도 길찾기 | |
private fun findNaverMap() { | |
val exNaver = "nmap://route?dlat=$desLat&dlng=$desLng&dname=$title" | |
Intent(Intent.ACTION_VIEW, Uri.parse(exNaver)).let { | |
startActivity(it) | |
} | |
} | |
// 카카오지도 길찾기 | |
private fun findKakaoMap() { | |
val exKakao = "kakaomap://route?ep=$desLat,$desLng" | |
Intent(Intent.ACTION_VIEW, Uri.parse(exKakao)).let { | |
startActivity(it) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment