Florent Anders Florent Anders - 3 months ago 32
Android Question

Let a webview load a website based on text input

I'm currently programming an own search engine and I would like to load the WebView which performs the search for me with the following search:

I put an Input box on top of the layout where the user enters his search keywords, for example "Android Webview". So, when the user types on search on his Keyboard or enter, I would like to let my WebView SearchWebView load the following URL: http://searchengine.com/search= The text which was entered

How can I do that?



The WebView documentation can help you with that!


To get the click on keyboard's "Done":

textView.setOnEditorActionListener(new OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId,
                KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
            return false;

In your EditText xml: