9

我完全不知道如何在 android SDK 中使用“animateCamera”的回调功能。

我想使用 onFinish 功能,谢谢。

public final void animateCamera(CameraUpdate 更新,GoogleMap.CancelableCallback 回调)

http://developer.android.com/reference/com/google/android/gms/maps/GoogleMap.html#animateCamera%28com.google.android.gms.maps.CameraUpdate,%20com.google.android.gms.maps .GoogleMap.CancelableCallback%29

http://developer.android.com/reference/com/google/android/gms/maps/GoogleMap.CancelableCallback.html

4

1 回答 1

13

不用担心,我无法相信在寻找年龄后发布此内容的那一刻,我在 google play maps api samples 中找到了一个显示它的示例....:

sdk\extras\google\google_play_services\samples\maps\src\com\example\mapdemo\CameraDemoActivity.java

changeCamera(CameraUpdateFactory.newCameraPosition(SYDNEY), 
        new CancelableCallback() {
    @Override
    public void onFinish() {
        Toast.makeText(getBaseContext(), "Animation to Sydney complete", 
            Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onCancel() {
        Toast.makeText(getBaseContext(), "Animation to Sydney canceled", 
            Toast.LENGTH_SHORT).show();
    }
});
于 2012-12-31T03:47:05.423 回答