开发者

Flash in an Android WebView - layering issue

I am trying to have interactive buttons in an android WebView that contains flash. As a test, I set up a HTML to load in a flash through with a set x/y size.

public class webz extends WebView {
private Drawable image;
public webz(Context context, AttributeSet attrs) {
    super(context, attrs);
    image=context.getResources().getDrawable(R.drawable.icon);
    getSettings().setPluginsEnabled(true);
}
@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    image.setBounds(100, 300, 150, 450);
   开发者_Go百科 image.draw(canvas);
}

}

I set up a test image that would overlay itself half over the flash, half over the unused canvas. once loaded, the flash will load over the canvas draw, leaving only the part over the HTML.

LINK TO SCREENSHOT

the answer to this question states that adobe's flash player creates a surfaceview inside of the webview. i assume this is the cause of the layering issue, but i have no idea how to overcome it.

does anyone know how to override this? the button has to also send key events to the flash (like you press the on screen button, and the A key to sent to the flash). if you know how to do this as well, it would be very helpful


Add your button to a layout and then set the layout to a dialog using setcontentview. When your activity is loaded, show your dialog as full screen transparent dialog.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜