Commit 16ee83c9 authored by Bastien Zigmann's avatar Bastien Zigmann

MOBILE APP : Correction de bug qui gardait le GPS désactivé quand on...

MOBILE APP : Correction de bug qui gardait le GPS désactivé quand on l'activait pendant le popup prévenant du fait qu'il était off et cliquait sur non
parent d2df5971
......@@ -24,7 +24,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -59,7 +59,12 @@ public class MainActivity extends AppCompatActivity {
.setNegativeButton("Non", new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) {
dialog.cancel();
callJS("geocropping.MobileSetGPSPosition(false);");
boolean IsLocalised = (((LocationManager) getSystemService( Context.LOCATION_SERVICE ))).isProviderEnabled(LocationManager.GPS_PROVIDER);
if ( !IsLocalised ) {
callJS("geocropping.MobileSetGPSPosition(false);");
}else{
callJS("geocropping.MobileSetGPSPosistion(true);");
}
}
});
final AlertDialog alert = builder.create();
......@@ -109,7 +114,6 @@ public class MainActivity extends AppCompatActivity {
}
}
// TODO : quand le popup est ouvert pour demander si on active le gps, si on l'active puis qu'on met "non" ça reste en posclick
private void configureGPS() {
locationListener = new LocationListener() {
@Override
......@@ -132,7 +136,6 @@ public class MainActivity extends AppCompatActivity {
};
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment