如何彻底关闭webview上的activity
展开全部
[mw_shl_code=java,true]appView.setVerticalScrollBarEnabled(false);
WebSettings webSetting = appView.getSettings();
webSetting.setJavaScriptEnabled(true);
webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
appView.addJavascriptInterface(new Object() {
public void closeActivity() {
mHandler.post(new Runnable() {
public void run() {
//appView.loadUrl("javascript:wave()");
PhonegapFrame.this.finish();
}
});
}
}, "javaMethod");[/mw_shl_code]
然后在html里面:
[mw_shl_code=html,true] function closeWindow() {
window.javaMethod.closeActivity();
}[/mw_shl_code]
WebSettings webSetting = appView.getSettings();
webSetting.setJavaScriptEnabled(true);
webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
appView.addJavascriptInterface(new Object() {
public void closeActivity() {
mHandler.post(new Runnable() {
public void run() {
//appView.loadUrl("javascript:wave()");
PhonegapFrame.this.finish();
}
});
}
}, "javaMethod");[/mw_shl_code]
然后在html里面:
[mw_shl_code=html,true] function closeWindow() {
window.javaMethod.closeActivity();
}[/mw_shl_code]
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询