我有这个代码的问题,"无法解决方法getMap().我没有找到问题所在,请求代码帮助,我使用Android Studio,需要使用Json的mySQL标记位置.
googleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.googleMap)).getMap();`
Run Code Online (Sandbox Code Playgroud)
这是完整的代码
public class MainActivity extends FragmentActivity {
private GoogleMap googleMap;
private Double Latitude = 0.00;
private Double Longitude = 0.00;
private GoogleApiClient client2;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
ArrayList<HashMap<String, String>> location = null;
String url = "http://www.evil.cl/getLatLon.php";
try {
JSONArray data = new JSONArray(getHttpGet(url));
location = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map;
for (int i = 0; i < data.length(); …Run Code Online (Sandbox Code Playgroud)