本文整理匯總了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();
}