作者rex60209 (Ghost)
看板AndroidDev
標題[問題]GPS定位問題(addMarker和onConnected)
時間Fri May 6 18:31:39 2016
各位程式的前輩好,小弟寫了一個會會使用GPS功能定位自己的程式但是他有問題
請問各位如何解決
BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher);
ic_launcher會是紅字請問如何解決(已經試過把import android.R)拿掉沒有用
public void onConnected(Bundle bundle) {
// 已經連線到Google Services
// 啟動位置更新服務
// 位置資訊更新的時候,應用程式會自動呼叫LocationListener.onLocationChanged
LocationServices.FusedLocationApi.requestLocationUpdates(
googleApiClient, locationRequest, MapsActivity.this);
這整串都是紅字請問怎麼解決
完整程式碼在這裡問題在很下面:
http://pastebin.com/ARZ2uiku
請各位幫我看看問題點謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.161.243.145
※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1462530701.A.5E4.html
→ FlowerYen: 程式不是你寫的嗎 怎麼會不知道resource名字? 05/06 20:08
→ FlowerYen: 程式不是你寫的? 連resource名字都忘了? 05/06 20:23
→ rex60209: 我是參考別人的教學文章打得 05/06 21:54
→ rex60209: 請問要如何修改? 我到Strings.xlm底下看不知道要改哪 05/06 22:08
→ FlowerYen: 剛剛用手機推文,沒注意到發了兩次 05/06 23:48
→ FlowerYen: R.drawble.ic_launcher,是給MAP MARKER套用的ICON 05/06 23:50
→ FlowerYen: 所以你可以找你喜歡的圖檔,丟進drawble裡 05/06 23:51
→ FlowerYen: BitmapDescriptorFactory.fromResource(R.drawable.xx) 05/06 23:52
→ FlowerYen: xx 就是你取的名字 05/06 23:52
→ FlowerYen: 不過還是建議你,從基本的開始學起 05/06 23:54
推 baobomb: 先檢查drawable裡有沒有圖檔吧 05/07 11:54