本文整理汇总了Java中android.webkit.WebView.reload方法的典型用法代码示例。如果您正苦于以下问题:Java WebView.reload方法的具体用法?Java WebView.reload怎么用?Java WebView.reload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.webkit.WebView
的用法示例。
在下文中一共展示了WebView.reload方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reload
import android.webkit.WebView; //导入方法依赖的package包/类
public UDWebView reload() {
WebView view = null;
if (this.getView() != null && (view = this.getView().getWebView()) != null) {
view.reload();
}
return this;
}
示例2: shouldOverrideUrlLoading
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("file")) {
// Keep local assets in this WebView.
return false;
} else if (url.startsWith("mailto:")) {
try {
MailTo mt = MailTo.parse(url);
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL, new String[]{mt.getTo()});
i.putExtra(Intent.EXTRA_SUBJECT, mt.getSubject());
context.startActivity(i);
view.reload();
}
catch (ActivityNotFoundException e) {
Log.w(TAG, "Problem with Intent.ACTION_SEND", e);
new AlertDialog.Builder(context)
.setTitle("Contact Info")
.setMessage( "Please send your feedback to: [email protected]" )
.setPositiveButton( "Done", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d("AlertDialog", "Positive");
}
})
.show();
}
return true;
} else {
// Open external URLs in Browser.
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
}
}
示例3: receiveCommand
import android.webkit.WebView; //导入方法依赖的package包/类
@Override
public void receiveCommand(WebView root, int commandId, @Nullable ReadableArray args) {
switch (commandId) {
case COMMAND_GO_BACK:
root.goBack();
break;
case COMMAND_GO_FORWARD:
root.goForward();
break;
case COMMAND_RELOAD:
root.reload();
break;
case COMMAND_STOP_LOADING:
root.stopLoading();
break;
case COMMAND_POST_MESSAGE:
try {
JSONObject eventInitDict = new JSONObject();
eventInitDict.put("data", args.getString(0));
root.loadUrl("javascript:(function () {" +
"var event;" +
"var data = " + eventInitDict.toString() + ";" +
"try {" +
"event = new MessageEvent('message', data);" +
"} catch (e) {" +
"event = document.createEvent('MessageEvent');" +
"event.initMessageEvent('message', true, true, data.data, data.origin, data.lastEventId, data.source);" +
"}" +
"document.dispatchEvent(event);" +
"})();");
} catch (JSONException e) {
throw new RuntimeException(e);
}
break;
case COMMAND_INJECT_JAVASCRIPT:
root.loadUrl("javascript:" + args.getString(0));
break;
}
}
示例4: reload
import android.webkit.WebView; //导入方法依赖的package包/类
/**
* 重载页面
*/
public static void reload(IQuickFragment webLoader, WebView wv, JSONObject param, Callback callback) {
wv.reload();
callback.applySuccess();
}