android - How to differentiate between a search query and an URL? -


i trying make android browser, have searchview.

right providing google search result whatever user enters in searchview, want differentiate between search query , url, (for example if user enters "facebook.com" user should directed "http://www.facebook.com").

i tried check if query followed ".com" not helpful when user trying access ".net" ".in" or domain followed else ".com".

any appreciated. thank you.

you can use

patterns.web_url.matcher(yourqueryorurl).matches(); 

it return true if url valid url , false if query , not url. handle cases .in , .net domains


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -