summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp
diff options
context:
space:
mode:
authorAntonio Zugaldia <antonio@mapbox.com>2016-10-11 09:17:07 -0400
committerGitHub <noreply@github.com>2016-10-11 09:17:07 -0400
commit4cc7e7de4f006cf6e2c73f49f55d46e7052207e2 (patch)
treeff7aca69e7339951e0e8446d582af54d9162336f /platform/android/MapboxGLAndroidSDKTestApp
parente3c79bfd34152bd3837fb3fdee764c15b13f1691 (diff)
downloadqtlocation-mapboxgl-4cc7e7de4f006cf6e2c73f49f55d46e7052207e2.tar.gz
[android] #6617 - Introduce a setConnected method to manually set a connected flag
* [android] introduce a setConnected method to manually set a connected flag * extend connected state to ConnectivityReceiver * extend connected state to ConnectivityReceiver
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java
index d3c66a22ad..e9dd9dc5f4 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/offline/OfflineActivity.java
@@ -13,8 +13,10 @@ import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.Toast;
+import com.mapbox.mapboxsdk.MapboxAccountManager;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
+import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
@@ -73,6 +75,13 @@ public class OfflineActivity extends AppCompatActivity
actionBar.setDisplayShowHomeEnabled(true);
}
+ // You can use MapboxAccountManager.setConnected(Boolean) to manually set the connectivity
+ // state of your app. This will override any checks performed via the ConnectivityManager.
+ //MapboxAccountManager.getInstance().setConnected(false);
+ Boolean connected = MapboxAccountManager.getInstance().isConnected();
+ Log.d(LOG_TAG, String.format(MapboxConstants.MAPBOX_LOCALE,
+ "MapboxAccountManager is connected: %b", connected));
+
// Set up map
mapView = (MapView) findViewById(R.id.mapView);
mapView.setStyleUrl(Style.MAPBOX_STREETS);