我有地图&我想点击按钮上的Map快照。
/**
* Called when the snapshot button is clicked.
*/
public void onScreenshot(View view) {
takeSnapshot();
}
private void takeSnapshot() {
System.out.println("Take SnapShot.......##################");
if (map == null) {
return;
}
final SnapshotReadyCallback callback = new SnapshotReadyCallback() {
@Override
public void onSnapshotReady(Bitmap snapshot) {
// Callback is called from the main thread, so we can modify the ImageView safely.
image.setImageBitmap(snapshot);
}
};
map.setOnMapLoadedCallback(new OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
map.snapshot(callback);
}
});
}
我在这一行上收到错误
final SnapshotReadyCallback callback = new SnapshotReadyCallback()
以下是我的堆栈跟踪。
请帮助我在过去两天尝试。