小编Hec*_*lez的帖子

Android,无法解析方法getMap()

我有这个代码的问题,"无法解决方法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)

android google-maps google-maps-markers

3
推荐指数
2
解决办法
4万
查看次数

标签 统计

android ×1

google-maps ×1

google-maps-markers ×1