I'm trying to set webview as a live wallpaper, but I have a problem with sizing it.
In the Engine I create a webview with WallpaperService's Context:
public WallpaperEngine(Context context) {
webView = new WebView(context);
...
}
And I draw it to wallpaper's canvas:
SurfaceHolder holder = getSurfaceHolder();
Canvas canvas = null;
try {
canvas = holder.lockCanvas();
if (canvas != null) {
webView.draw(canvas);
}
} finally {
if (canvas != null)
holder.unlockCanvasAndPost(canvas);
}
But the wallpaper will be white and javascript reports, that window's size is 0px.
How to set size of the WebView?