[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
This commit is contained in:
committed by
Ivo van Dongen
parent
cec7d12e37
commit
43f89d6b6a
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user