locman1=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
        
        if (locman1.isProviderEnabled(LocationManager.NETWORK_PROVIDER)){
         TextView textview;
textview=(TextView)findViewById(R.id.lng);
textview.setText("network:enable");
        }
        
        
        locman1.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, loclistener);
        Location location=new Location("a");
        location=locman1.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
        if (location!=null){
TextView textview;
textview=(TextView)findViewById(R.id.lat);
textview.setText("lat:" +location.getLatitude());
}
该加的权限也都加了,咋就得不到啊

解决方案 »

  1.   

    log信息为日志信息LocationManager.GPS应该是可以的
    LocationManager.NETWORK_PROVIDER我也没取到
      

  2.   

    我在虚拟机上测试过,network取不到,但GPS可以
      

  3.   

    我也是network一直取不到。gps是可以的。在真机中兴 n880上测试的。找遍了也找不到原因啊。
      

  4.   

    那个貌似是要通过基站定位(有一种为三角定位)才能得到吧,Google的New_Work在中国支持的不好,还是咋滴不是很清楚
      

  5.   

    要把android设置中“位置”选项中的【使用无线网络】打勾