- 在代碼中經過loadUrl加載百度的首頁,此時的行爲屬於(B)方式。
- 能夠發現大概的執行順序是:onPageStarted ——> shouldOverrideUrlLoading ——> onPageFinished
- 那麼爲何會執行屢次呢,思考一下?具體能夠看一下7.2得出的結論分析。
X5LogUtils: -------onPageStarted-------http://www.baidu.com/
X5LogUtils: -------shouldOverrideUrlLoading-------https://m.baidu.com/?from=844b&vit=fps
X5LogUtils: -------onPageFinished-------http://www.baidu.com/
X5LogUtils: -------onPageStarted-------https://m.baidu.com/?from=844b&vit=fps
X5LogUtils: -------onReceivedTitle-------百度一下
X5LogUtils: -------shouldOverrideUrlLoading-------http://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
X5LogUtils: -------onPageFinished-------https://m.baidu.com/?from=844b&vit=fps
X5LogUtils: -------shouldOverrideUrlLoading-------https://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
X5LogUtils: -------onPageStarted-------http://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
X5LogUtils: -------onPageFinished-------http://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
X5LogUtils: -------onPageStarted-------https://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
X5LogUtils: -------onReceivedTitle-------百度一下,你就知道
X5LogUtils: -------onPageFinished-------https://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
複製代碼
- 在首頁,點擊一下「hao123」,跳轉到www.hao123.com的主頁上來,此時的行爲屬於(A)方式。
- 能夠發現大概的執行順序是:shouldOverrideUrlLoading ——> onPageStarted ——> onPageFinished
X5LogUtils: -------shouldOverrideUrlLoading-------http://m.hao123.com/?ssid=0&from=844b&bd_page_type=1&uid=0&pu=sz%401321_1002%2Cta%40utouch_2_9.0_2_6.2&idx=30000&itj=39
X5LogUtils: -------onPageStarted-------http://m.hao123.com/?ssid=0&from=844b&bd_page_type=1&uid=0&pu=sz%401321_1002%2Cta%40utouch_2_9.0_2_6.2&idx=30000&itj=39
X5LogUtils: -------onReceivedTitle-------hao123導航-上網從這裏開始
X5LogUtils: -------onPageFinished-------http://m.hao123.com/?ssid=0&from=844b&bd_page_type=1&uid=0&pu=sz%401321_1002%2Cta%40utouch_2_9.0_2_6.2&idx=30000&itj=39
複製代碼
- 而後在hao123頁面,點擊優酷網進行跳轉,此時的行爲屬於(A)方式。
X5LogUtils: -------shouldOverrideUrlLoading-------http://m.hao123.com/j.php?z=2&page=index_cxv3&pos=cydhwt_n2&category=ty&title=%E4%BC%98%E9%85%B7%E7%BD%91&qt=tz&url=http%3A%2F%2Fwww.youku.com%2F&key=58193753e7a868d9a013056c6c4cd77b
X5LogUtils: -------onPageStarted-------http://m.hao123.com/j.php?z=2&page=index_cxv3&pos=cydhwt_n2&category=ty&title=%E4%BC%98%E9%85%B7%E7%BD%91&qt=tz&url=http%3A%2F%2Fwww.youku.com%2F&key=58193753e7a868d9a013056c6c4cd77b
X5LogUtils: -------shouldOverrideUrlLoading-------http://www.youku.com/
X5LogUtils: -------onPageFinished-------http://m.hao123.com/j.php?z=2&page=index_cxv3&pos=cydhwt_n2&category=ty&title=%E4%BC%98%E9%85%B7%E7%BD%91&qt=tz&url=http%3A%2F%2Fwww.youku.com%2F&key=58193753e7a868d9a013056c6c4cd77b
X5LogUtils: -------onPageStarted-------http://www.youku.com/
X5LogUtils: -------shouldOverrideUrlLoading-------https://www.youku.com/
X5LogUtils: -------onPageFinished-------http://www.youku.com/
X5LogUtils: -------onPageStarted-------https://www.youku.com/
X5LogUtils: -------onReceivedTitle-------優酷視頻-首頁
X5LogUtils: -------onPageFinished-------https://www.youku.com/
複製代碼
- 而後從優酷頁面回退到hao123頁面,看看又回執行哪些方法。
X5LogUtils: -------onPageStarted-------http://m.hao123.com/?ssid=0&from=844b&bd_page_type=1&uid=0&pu=sz%401321_1002%2Cta%40utouch_2_9.0_2_6.2&idx=30000&itj=39
X5LogUtils: -------onReceivedTitle-------hao123導航-上網從這裏開始
X5LogUtils: -------onReceivedTitle-------hao123導航-上網從這裏開始
X5LogUtils: -------onPageFinished-------http://m.hao123.com/?ssid=0&from=844b&bd_page_type=1&uid=0&pu=sz%401321_1002%2Cta%40utouch_2_9.0_2_6.2&idx=30000&itj=39
複製代碼
- 而後從hao123頁面回退到百度首頁,看看又回執行哪些方法。
X5LogUtils: -------onPageStarted-------https://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
X5LogUtils: -------onReceivedTitle-------百度一下,你就知道
X5LogUtils: -------onReceivedTitle-------百度一下,你就知道
X5LogUtils: -------onPageFinished-------https://m.baidu.com/?cip=117.101.19.67&baiduid=C6FCEED198C994E0D653C094F2708C32&from=844b&vit=fps?from=844b&vit=fps&index=&ssid=0&bd_page_type=1&logid=12175252243175665635&pu=sz%401321_480&t_noscript=jump
複製代碼