diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-11-08 18:10:15 +0200 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-11-09 15:24:15 +0200 |
commit | 43f89d6b6a040fea97a882ca620ca7c890afd364 (patch) | |
tree | d4ae0c036a57267fd94e08778938713f2f9cdc0b /platform/android/MapboxGLAndroidSDKTestApp/src/main/java | |
parent | cec7d12e37e61cad8c631a97f4d0a52eeba81a7b (diff) | |
download | qtlocation-mapboxgl-43f89d6b6a040fea97a882ca620ca7c890afd364.tar.gz |
[android] fix map snapshotter marker example
The reference to the MapSnapshotter needs to be held for the duration of the snapshot, otherwise it might be GC'd
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main/java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java index 582d4a29c5..781e7b6334 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/snapshot/MapSnapshotterMarkerActivity.java @@ -25,6 +25,8 @@ import timber.log.Timber; */ public class MapSnapshotterMarkerActivity extends AppCompatActivity implements MapSnapshotter.SnapshotReadyCallback { + private MapSnapshotter mapSnapshotter; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -40,7 +42,7 @@ public class MapSnapshotterMarkerActivity extends AppCompatActivity implements M Timber.i("Starting snapshot"); - MapSnapshotter mapSnapshotter = new MapSnapshotter( + mapSnapshotter = new MapSnapshotter( getApplicationContext(), new MapSnapshotter .Options(Math.min(container.getMeasuredWidth(), 1024), Math.min(container.getMeasuredHeight(), 1024)) |