没有为SnapshotReadyCallback找到类定义

时间:2014-03-25 09:29:50

标签: android google-maps-android-api-2 snapshot

我有地图&我想点击按钮上的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()

以下是我的堆栈跟踪。

enter image description here

请帮助我在过去两天尝试。

1 个答案:

答案 0 :(得分:0)

选中answer

似乎你的谷歌游戏服务api已经过时了。

修改 i.n.e.f通过向构建路径添加Google Play服务

解决了这个问题