Android - Unable to get the gps location on the emulator

后端 未结 4 1116
不知归路
不知归路 2020-12-06 18:12

i\'m tring to use the gps on the android emulator, i\'ve the following code:

public class NL extends Activity {

 private LocationManager locmgr = null;

 @O         


        
4条回答
  •  遥遥无期
    2020-12-06 18:36

    if all you what you described is done than maybe you are not probably not ur gps is on in emulator.go to setting:->Location and Security:->and use gps satelites should be checked


    edited:ithink you have to use location manager without criteria type.



    LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
    
    loc=mlocManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    

    ------than try to get long. and lat.

提交回复
热议问题