|
@@ -100,11 +100,13 @@ public class MainActivity extends ReactActivity {
|
|
|
if (hasGPS) {
|
|
if (hasGPS) {
|
|
|
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0f,
|
|
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0f,
|
|
|
gpsListener);
|
|
gpsListener);
|
|
|
|
|
+ Log.i("LLLLLLLLLLLLLLocation","GPS enable");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (hasNetwork){
|
|
if (hasNetwork){
|
|
|
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000, 0f,
|
|
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000, 0f,
|
|
|
networkListener);
|
|
networkListener);
|
|
|
|
|
+ Log.i("LLLLLLLLLLLLLLocation","Network enable");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// if (gpsLocation!=null && networkLocation!=null){
|
|
// if (gpsLocation!=null && networkLocation!=null){
|
|
@@ -140,6 +142,8 @@ public class MainActivity extends ReactActivity {
|
|
|
// TODO Auto-generated method stub
|
|
// TODO Auto-generated method stub
|
|
|
// 更新当前经纬度
|
|
// 更新当前经纬度
|
|
|
gpsLocation = arg0;
|
|
gpsLocation = arg0;
|
|
|
|
|
+ Log.i("LLLLLLLLLLLLLLocation","GPS");
|
|
|
|
|
+ Toast.makeText(getApplicationContext(),"gps location",Toast.LENGTH_LONG).show();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -168,6 +172,8 @@ public class MainActivity extends ReactActivity {
|
|
|
// TODO Auto-generated method stub
|
|
// TODO Auto-generated method stub
|
|
|
// 更新当前经纬度
|
|
// 更新当前经纬度
|
|
|
networkLocation = arg0;
|
|
networkLocation = arg0;
|
|
|
|
|
+ Log.i("LLLLLLLLLLLLLLocation","Network");
|
|
|
|
|
+ Toast.makeText(getApplicationContext(),"network location",Toast.LENGTH_LONG).show();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|