java - How to Change Global Variable in Android -
i want make mapping application , have problem changing global variable in code. how change global latlng in global variable in if else
in method bundle.. please give me solution..thank you..
public class arahkan extends fragmentactivity { private static final int direction = menu.first + 1; private static final int exit = menu.first + 2; googlemap map; string tampil2 = getintent().getextras().getstring("key"); public latlng jakarta = new latlng(-6.175467640504223,106.82718157768248); // how change this.. ?? class data { public data(float lng, float lat, string title, string snippet, string icon) { super(); this.lat = (float)lat; this.lng = (float)lng; this.title = title; this.snippet = snippet; this.icon = icon; } float lat; float lng; string title; string snippet; string icon; } @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.peta); if(tampil2.equalsignorecase("coba")){ //here... how change value variabel latlng jakarta ?? } if(tampil2.equalsignorecase("bisa")){ }
please me ...
latlng creates immutable, latitude & longitude member variables "final", cannot update it. see here
for scenario, recommend location class. here tutorial on using location api
Comments
Post a Comment