开发者

Android Live Wallpaper onSurfaceDestroyed()

I created a live wallpaper but am having trouble with "Set Wallpaper".

The preview and prefs all work well.

When I click "Set Wallpaper" the new settings are not shown on the screen. My wallpaper is not updated since all updates are in onSurfaceCreated(). Though if I trigger onVisibilityChanged by navigating to settings or such. When come it does kick in and work.

My Logs show:

...
...
...
onVisibilityChanged()
onSurfaceDestroyed()

And it stops there.?

From my understanding it should be calling onSurfcaeCreated() next.

I am not sure why it is dying on onSurfaceDestroyed().

        @Override
    public void onSurfaceCreated(SurfaceHolder holder) {
        Logger.log(Global.debugOn, Logger.LEVEL_INFO, "A", "MainEngine > onSurfaceCreated");
        super.onSurfaceCreated(holder);

        dbHelper.open(false);
        Global.overridePause = true;
        mPhysics.addImages();
        Global.overridePause = false;
        mThreadPhysics.resume();
        mThreadDraw.holder = holder;
        mThreadDraw.resume();

    }

    @Override
    public void onSurfaceDestroyed(SurfaceHolder holder) {
        Logger.log(Global.debugOn, Logger.LEVEL_INFO, "A", "MainEngine > onSurfaceDestroyed");
        super.onSurfaceDestroyed(hol开发者_JAVA技巧der);

        dbHelper.close();
        mThreadPhysics.pause();
        mThreadDraw.pause();
        mThreadDraw.holder = null;

    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜