-- By: QQ3
local urls={"https://www.google.com/search?q=%s","https://m.baidu.com/s?wd=%s","https://m.so.com/s?q=%s","http://cn.bing.com/search?q=%s","http://m.chinaso.com/page/search.htm?keys=%s","https://m.sogou.com/web/searchList.jsp?keyword=%s","https://m.sm.cn/s?q=%s"}
searchEdtTxt.setOnEditorActionListener{
onEditorAction=function(view,action,event)
local text=tostring(view.text)
if text~=nil and text~="" then
searchEdtTxt.setHint(text)
local URLEncodeer=import"java.net.URLEncoder"
for index in pairs(urls) do
if allWebView[index] and urls[index]~=nil and urls[index]~="" then
local url=tostring(urls[index]):format(URLEncoder.encode(text))
if pager.getCurrentItem()+1==index then
task(100,function()allWebView[index].loadUrl(url)end)--解决当前页面无法加载(与默认搜索事件冲突被覆盖)的问题