[問題] google Map的問題

看板AndroidDev作者 (暖男葛葛)時間10年前 (2016/01/21 15:19), 編輯推噓1(106)
留言7則, 3人參與, 最新討論串1/1
程式碼在此:http://pastebin.com/FJsdudJS 這程式碼onConnected 部分一直有問題 一直要我add permission check 然後出現 if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // TODO: Consider calling // public void requestPermissions(@NonNull String[] permissions, int requestCode) // here to request the missing permissions, and then overriding // public void onRequestPermissionsResult(int requestCode, String[] permissions, // int[] grantResults) // to handle the case where the user grants the permission. See the documentation // for Activity#requestPermissions for more details. return; } 但一樣不能用 標記點依樣不能換到我目前的位置.... 請求大大幫忙!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 39.12.152.101 ※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1453360785.A.439.html

01/21 15:33, , 1F
你內文的code沒寫完阿,api level 6.0以上,有些permi
01/21 15:33, 1F

01/21 15:33, , 2F
ssion要動態取得。因為你的 onConnected裡用到Locatio
01/21 15:33, 2F

01/21 15:33, , 3F
nServices,所以要有location的permission。詳細請看h
01/21 15:33, 3F

01/21 15:33, , 4F
ttp://goo.gl/JvPUQ8
01/21 15:33, 4F

01/21 15:44, , 5F
有辦法不要增加那行嗎 = = 因為同學就不用增加那程式
01/21 15:44, 5F

01/21 15:47, , 6F
不用增加會不會是因為沒有把SDK支援到6.0?
01/21 15:47, 6F

01/21 16:21, , 7F
解決了 好像是沒支援到6.0.. 但又沒辦法抓到GPS了:((
01/21 16:21, 7F
文章代碼(AID): #1Me8QHGv (AndroidDev)