{"id":199,"date":"2016-05-19T10:16:46","date_gmt":"2016-05-19T02:16:46","guid":{"rendered":"http:\/\/www.prayerlaputa.com\/?p=199"},"modified":"2016-05-19T10:16:46","modified_gmt":"2016-05-19T02:16:46","slug":"android%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e6%94%b6%e8%97%8f","status":"publish","type":"post","link":"http:\/\/prayerlaputa.com\/?p=199","title":{"rendered":"android\u5e38\u89c1\u95ee\u9898\u6536\u85cf"},"content":{"rendered":"<p>\u6700\u8fd1\u89e3\u51b3\u7684\u95ee\u9898\u6bd4\u8f83\u591a\uff0c\u6574\u7406\u4e00\u4e0b\uff0c\u65b9\u4fbf\u540e\u7eed\u81ea\u5df1\u67e5\u3002<br \/>\n\u5148\u9001\u4e0a\u6211\u770b\u8fc7\u7684\u51e0\u7bc7\u4e0d\u9519\u7684\u6587\u7ae0\uff1a<br \/>\n\u4f20\u9001\u95e81\uff1a<a href=\"http:\/\/blog.csdn.net\/t12x3456\/article\/details\/13769731\">Android WebView\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848\u6c47\u603b<\/a><br \/>\n\u4f20\u9001\u95e82\uff1a<a href=\"http:\/\/blog.csdn.net\/liuhe688\/article\/details\/6549263\">\u6d45\u8c08WebView\u7684\u4f7f\u7528<\/a><br \/>\n\u4f20\u9001\u95e83\uff1a<a href=\"http:\/\/blog.csdn.net\/moubenmao_jun\/article\/details\/17078269\">WebView Cache \u7f13\u5b58\u6e05\u9664<\/a><!--more--><br \/>\n\u4f20\u9001\u95e84\uff1a<a href=\"http:\/\/blog.csdn.net\/t12x3456\/article\/details\/39134961\">Android WebView \u56e0\u91cd\u5b9a\u5411\u65e0\u6cd5\u6b63\u5e38goBack()\u89e3\u51b3\u65b9\u6848<\/a><br \/>\n\u4f20\u9001\u95e85\uff1a<a href=\"http:\/\/blog.csdn.net\/android_tutor\/article\/details\/6165470\">Android\u9ad8\u624b\u8fdb\u9636\u6559\u7a0b(\u4e8c\u5341\u4e09)\u4e4b&#8212;Android\u4e2d\u7684\u65e5\u5386\u8bfb\u5199\u64cd\u4f5c!!!<\/a>\u00a0 \u00a0 \u00a0<a id=\"cb_post_title_url\" href=\"http:\/\/www.cnblogs.com\/wblyuyang\/p\/4050377.html\">Android \u5411\u7cfb\u7edf\u65e5\u5386\u4e2d\u6dfb\u52a0\u4e8b\u4ef6<\/a><br \/>\n\u81ea\u5df1\u9047\u5230\u7684\u4e00\u4e9b\u95ee\u9898\uff1a<\/p>\n<ol>\n<li>\u00a0\u5982\u4f55\u5224\u65adwebview \u5df2\u7ecf\u5b8c\u6210load\u64cd\u4f5c\uff1f\n<ol>\n<li>\u76ee\u524d\u672a\u627e\u5230\u5408\u7406\u7684\u65b9\u5f0f\uff0cwebview\u7684WebViewClient\u4e2d\u6709\u4e00\u4e2aonPageFinished\u65b9\u6cd5\uff0c\u4f46\u8fd9\u4e2a\u65b9\u6cd5\u7684\u884c\u4e3a\u5f88\u8be1\u5f02\uff0c\u82e5\u8bbf\u95ee\u7684\u662f\u4e00\u4e2a\u6b63\u5e38\u3001\u6709\u6548\u7684\u7ad9\u70b9\uff0cwebview\u5728load\u5b8c\u9875\u9762\u540eonPageFinished\u4ec5\u88ab\u8c03\u7528\u4e00\u6b21\uff1b\u4f46\u5982\u679c\u7ad9\u70b9\u65e0\u6548\u3001\u4e0d\u53ef\u7528\uff08HTTP response\u7684\u72b6\u6001\u7801\u4e0d\u662f200\uff09\uff0conPageFinished\u53ef\u80fd\u8c03\u7528\u4e24\u6b21\u6216\u662f\u591a\u6b21\uff08stackoverflow\u4e0a\u6709\u5f88\u591a\u5e16\u5b50\u8ba8\u8bba\u8fd9\u95ee\u9898\uff0c\u5982\u4e0b\uff1ahttp:\/\/stackoverflow.com\/questions\/7670364\/onpagestart-called-many-times-and-onpagefinished-not-called-for-single-page \u00a0http:\/\/stackoverflow.com\/questions\/18282892\/android-webview-onpagefinished-called-twice \u00a0 \u00a0http:\/\/stackoverflow.com\/questions\/5049616\/android-webviewclient-callbacks-called-too-often \uff0c\u5509\u2026\u2026\u63a5\u53e3\u8bbe\u8ba1\u4e0d\u5408\u7406\u554a\uff09\uff0c\u56e0\u6b64\u4e0d\u5efa\u8bae\u5728\u6b64\u5904\u52a0\u4e0aload\u5b8c\u6bd5\u65f6\u9700\u8981\u8c03\u7528\u7684\u56de\u8c03\u3002<\/li>\n<li>WebChromeClient\u4e2d\u6709\u4e00\u4e2aonProgressChanged\u65b9\u6cd5\uff0c\u4f20\u5165\u53c2\u6570\u4e2d\u6709\u4e00\u4e2aint\u503c\u8868\u793a\u5f53\u524d\u9875\u9762\u8f7d\u5165\u767e\u5206\u6bd4\uff0c\u4f46\u4eb2\u6d4b\u4e5f\u4e0d\u597d\u7528\uff0c\u4f20\u5165\u7684int\u503c\u5e76\u4e0d\u7a33\u5b9a\uff0c\u6709\u65f6\u7684\u4ece0,15\u4e00\u4e0b\u5c31\u5230\u4e8690\uff0c\u6709\u65f6\u53ea\u4f200\uff0c20\u7b49\uff0c\u5e76\u4e14\u6211\u8bb0\u5f97\u5f53\u65f6\u6d4b\u8bd5\u7684\u65f6\u5019\u8bf7\u6c42\u65e0\u6548\u7ad9\u70b9\u65f6int\u503c\u4e5f\u6bd4\u8f83\u5947\u602a\uff0c\u8bb0\u4e0d\u6e05\u4e86\u3002<\/li>\n<li>\u7f51\u4e0a\u6709\u79cd\u5199\u6cd5\uff0c\u8986\u76d6loadUrl\uff0c\u4f7f\u7528HttpClient\u81ea\u5df1\u8fdb\u884c\u7f51\u7edc\u8bf7\u6c42\u7684\u6536\u53d1\u64cd\u4f5c\uff0c\u62ff\u5230\u8fd4\u56de\u62a5\u6587\u540e\u4f7f\u7528webview\u7684loadData\u65b9\u6cd5\u8f7d\u5165\u9875\u9762\uff0c\u4f46\u82e5\u4e00\u4e2a\u9875\u9762\u4e2d\u6709\u5f88\u591a\u8d44\u6e90\u9700\u8981\u5728\u8f7d\u5165\u65f6\u4e0b\u8f7d\uff0c\u90a3\u5c31\u9700\u8981\u5728\u62ff\u5230\u8fd4\u56de\u62a5\u6587\u540e\u8fdb\u4e00\u6b65\u5904\u7406\uff0c\u5426\u5219\u9875\u9762\u663e\u793a\u80af\u5b9a\u4e0d\u6b63\u5e38\uff08\u6bd4\u5982css\u6587\u4ef6\u6ca1\u4e0b\u8f7d\u3001js\u6587\u4ef6\u6ca1\u4e0b\u7b49\uff09<\/li>\n<\/ol>\n<\/li>\n<li>\u00a0PopupWindow\u663e\u793a\u540e\uff0c\u7acb\u5373\u8c03\u7528\u8f6f\u952e\u76d8\uff0c\u8f6f\u952e\u76d8\u4e0d\u663e\u793a\n<ol>\n<li>\u662f\u5426\u5728UI\u7ebf\u7a0b\uff1f<\/li>\n<li>\u53ef\u80fd\u9700\u8981\u5ef6\u65f6\uff1f\u82e5PopupWindow\u5185\u90e8\u7684\u5185\u5bb9\u662f\u65b0\u521b\u5efa\u7684\uff0c\u53ef\u80fd\u9700\u8981\u5ef6\u65f6\u51e0\u767e\u6beb\u79d2\u3001\u7b49\u5185\u5bb9\uff08\u6240\u6709\u7684View\uff09\u5168\u90e8\u521b\u5efa\u540e\u518d\u8c03\u7528ImputManager\u7684showSoftInput\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u7528timer\u6216\u662fhandler\u52a0\u4e0a\u5ef6\u65f6\u3001\u7b49\u5f85<\/li>\n<li>PopupWindow\u5f39\u51fa\u540e\u5176\u4ed6\u5730\u65b9\u53d8\u6697\u7684\u6548\u679c\n<ol>\n<li>\/\/\u8bbe\u7f6e\u80cc\u666f\u989c\u8272\u53d8\u6697<br \/>\nWindowManager.LayoutParams lp=getWindow().getAttributes();<br \/>\nlp.alpha=0.3f;<br \/>\ngetWindow().setAttributes(lp); \u00a0\/\/\u5728\u5f39\u51fa\u65f6\u8bbe\u7f6e\u900f\u660e\u5ea6,0.7\u6bd4\u8f83\u5408\u9002,\u7136\u540e\u5728dismiss\u65f6\u91cd\u65b0\u8bbe\u7f6e\u56de\u6765,\u8bbe\u7f6e\u62101<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>webview\u63a7\u4ef6\u8bbf\u95eehttps\u7ad9\u70b9\uff0c\u76f4\u63a5\u663e\u793a\u9519\u8bef\u6216\u662f\u7a7a\u767d\u9875\n<ol>\n<li>https\u7ad9\u70b9\u662f\u5426\u90e8\u7f72\u4e86\u6709\u6548\u7684\u8bc1\u4e66\uff1f\u5982\u679c\u6ca1\u6709\u5c31\u4f1a\u62a5\u9519\uff0c\u82e5\u9700\u8981\u5c3d\u5feb\u6d4b\u8bd5\u53ef\u4ee5\u5728webview\u4e2d\u914d\u7f6e\u4fe1\u4efb\u6240\u6709\u7ad9\u70b9\uff0c\u9700\u8981\u8bbe\u7f6e\u65b0\u7684WebViewClient\uff0c\u8986\u76d6\u5176\u4e2d\u7684onReceivedSslError\u65b9\u6cd5\uff0c\u5982\u4e0b\uff1a<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\npublic void onReceivedSslError(WebView dview, SslErrorHandler handler, SslError error){\nhandler.procced();\n}\n<\/pre>\n<p>&nbsp;<br \/>\n&nbsp;<br \/>\nTO BE CONTINUED&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u89e3\u51b3\u7684\u95ee\u9898\u6bd4\u8f83\u591a\uff0c\u6574\u7406\u4e00\u4e0b\uff0c\u65b9\u4fbf\u540e\u7eed\u81ea\u5df1\u67e5\u3002 \u5148\u9001\u4e0a\u6211\u770b\u8fc7\u7684\u51e0\u7bc7\u4e0d\u9519\u7684\u6587\u7ae0\uff1a \u4f20\u9001\u95e81\uff1aAndroid W <a href='http:\/\/prayerlaputa.com\/?p=199' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[2,12],"tags":[26],"_links":{"self":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/199"}],"collection":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=199"}],"version-history":[{"count":0,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions"}],"wp:attachment":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}