webview を使用して Google App Engine Web アプリを表示する Android アプリがあります。HTTP Error 504 Gateway timeout
アプリで発生したデフォルトを上書きする方法は?
HTTP Error 504 Gateway timeout
The server, while acting as a gateway or proxy, did not receive a
timely response from the upstream server it accessed in attempting
to complete the request.
onReceivedError
インターネット接続が利用できない場合やその他のエラーが発生した場合に、どちらが機能するかを既にオーバーライドしています。
webView.setWebViewClient(new WebViewClient(){
...
@SuppressLint("DefaultLocale")
@Override
public void onReceivedError(WebView view, int errorCode,String description, String failingUrl) {
try {
String template = streamToString(getAssets().open("html/error.html"));
String data = template.replaceAll("%DESCRIPTION%", description.toLowerCase())
.replaceAll("%WEBSITE_URL%", WEBSITE_URL);
view.loadDataWithBaseURL("file:///android_asset/html/", data, "text/html", "utf-8", null);
} catch (IOException e) {
e.printStackTrace();
}
}
});
onReceivedError
HTTP エラーのみを受信できません ネットワーク エラーですか? 回避策はありますか?Android WebView はどのように HTTP エラーをインターセプトできますか?