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());
}
该加的权限也都加了,咋就得不到啊
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());
}
该加的权限也都加了,咋就得不到啊
LocationManager.NETWORK_PROVIDER我也没取到