我想映射一个应用程序,但是我在代码中更改全局变量时遇到了问题。如何在方法包中的if else
中更改全局变量中的全局latlng ..请给我解决方案..谢谢..
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 TO 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 TO CHANGE VALUE FROM VARIABEL LATLNG JAKARTA ??
}
if(tampil2.equalsIgnoreCase("bisa")){
}
请帮助我......