標題:
MyWebView
[打印本頁]
作者:
ray
時間:
2012-11-23 19:14
標題:
MyWebView
[attach]635[/attach]
作者:
ray
時間:
2012-11-23 19:27
mGameContent.setWebChromeClient(new MyWebChromeClient());
mGameContent.setWebViewClient(new MyWebViewClient());
複製代碼
作者:
ray
時間:
2012-11-23 19:54
public class MyWebChromeClient extends WebChromeClient
{
@Override
public boolean onJsConfirm(WebView view,String url,String message,final JsResult result)
{
}
}
複製代碼
作者:
ray
時間:
2012-11-23 20:03
final AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
builder.setTitle(getResources().getString(R.string.app_name));
builder.setMessage(message);
複製代碼
作者:
ray
時間:
2012-11-23 20:16
builder.setPositiveButton("確定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
複製代碼
作者:
ray
時間:
2012-11-23 20:23
builder.setPositiveButton("確定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
result.confirm();
}
});
builder.setNeutralButton("取消", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
result.cancel();
}
});
複製代碼
作者:
ray
時間:
2012-11-23 20:28
AlertDialog dialog = builder.create();
dialog.show();
return true;
複製代碼
作者:
ray
時間:
2012-11-23 20:55
public class MyWebViewClient extends WebViewClient
{
@Override
public void onReceivedError(WebView view,int errorCode,String description,String failingUrl)
{
}
}
複製代碼
作者:
ray
時間:
2012-11-23 21:01
final String data = "<br><br><center>網路21點必須要連接網路才能執行</center>";
final String mineType = "text/html";
final String encoding = "utf-8";
複製代碼
作者:
ray
時間:
2012-11-23 21:09
view.loadDataWithBaseURL("", data, mimeType, encoding, "");
super.onReceivedError(view, errorCode, description, failingUrl);
複製代碼
作者:
ray
時間:
2012-11-26 18:42
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2