android 怎么实现window.open和自带浏览器一样的效果,就是在原有的webview上新建一个webview,但不是全屏,右上角有个关闭按钮!表达能力不好,效果图如下:

WebView Android window.open js 新窗口
------解决方案--------------------
public class TutorialView extends RelativeLayout {
private View baseView;
public TutorialView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
}
public TutorialView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
mContext = context;
}
public TutorialView(Context context) {
this(context, null);
mContext = context;
}
public TutorialView(Context context, int step) {
this(context);
this.step = step;
mContext = context;
init();
}
private void init() {
baseView = LayoutInflater.from(mContext).inflate(
R.layout.my_relative_view, this);
}
}
这样就可以了。具体的逻辑你可以写到init里,比如webView的内容啊,closebutton的监听啊。或者加一些其他的方法。