|
@@ -10,6 +10,8 @@ import android.content.Context;
|
|
|
import android.content.pm.PackageManager;
|
|
|
import android.os.Bundle;
|
|
|
import android.util.Log;
|
|
|
+import android.widget.CompoundButton;
|
|
|
+import android.widget.Switch;
|
|
|
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
|
@@ -17,6 +19,9 @@ public class MainActivity extends AppCompatActivity {
|
|
|
Context appContx = null;
|
|
|
boolean locPermGranted = false;
|
|
|
|
|
|
+ private Switch simpleSwitch;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
@@ -37,6 +42,15 @@ public class MainActivity extends AppCompatActivity {
|
|
|
Log.i(TAG, "Permissions already granted.");
|
|
|
locPermGranted = true;
|
|
|
}
|
|
|
+
|
|
|
+ simpleSwitch = (Switch) findViewById(R.id.enableTrackingSwitch);
|
|
|
+
|
|
|
+ simpleSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
|
|
+ Log.i(TAG,"State: " + Boolean.toString(b));
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
ActivityResultLauncher<String[]> locationPermissionRequest =
|