TAILIEUCHUNG - Android SDK (phần 7)

Creating Map-Based Activities ❘ 267 (); (false); (false); (true); (); String provider = (criteria, true); Location location = (provider); updateWithNewLocation(location); (provider, 2000, 10, locationListener); } 6. The final step is to modify the updateWithNewLocation method to re-center the map on the current location using the Map Controller. private void updateWithNewLocation(Location location) { String latLongString; TextView myLocationText; myLocationText = (TextView)findViewById(); String addressString = "No address found"; if (location != null) { // Update the map location. Double geoLat = ()*1E6; Double geoLng = ()*1E6; GeoPoint point = new. | Creating Map-Based Activities 267 false false true String provider criteria true Location location provider updateWithNewLocation location provider 2000 10 locationListener 6. The final step is to modify the updateWithNewLocation method to re-center the map on the current location using the Map Controller. private void updateWithNewLocation Location location String latLongString Textview myLocationText myLocationText TextView findViewByld String addressString No address found if location null Update the map location. Double geoLat 1E6 Double geoLng 1E6 GeoPoint point new GeoPoint point double lat double lng latLongString Lat lat nLong lng double latitude double longitude Geocoder gc new Geocoder this try List Address addresses latitude longitude 1 StringBuilder sb new StringBuilder if 0 Address address 0 for int i 0 i i i .append n .append n .append n 268 CHAPTERS MAPS GEOCODING AND LOCATION-BASED SERVICES addressString catch lOException e else latLongString No location found Your Current Position is n latLongString n addressString All code snippets in this example are part of the Chapter 8 Where Am I project available for download at . Creating and Using Overlays Overlays enable you to add annotations and click handling to .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.