title: how to search text in webview
body: <p>I am working in android... I am a newbie in this field... I developed a webview...i need to search for a particular text inside the webview... I searched about some questions like t<a href="https://stackoverflow.com/questions/9481169/how-to-get-the-selected-text-in-android-webview?lq=1">hi</a>s but i didn't get a proper answer</p>
  
  <p>I did this much code but when executed the webview is showing but the buttons i gave in the code are missing</p>
  
  <p>*</p>
  
  <pre><code>private static final int SEARCH_MENU_ID = Menu.FIRST;  
  
      @Override  
      public boolean onCreateOptionsMenu(Menu menu){  
      super.onCreateOptionsMenu(menu);  
  
      menu.add(0, SEARCH_MENU_ID, 0, "Search");  
  
      return true;  
      }  
  
      public boolean onPrepareOptionsMenu(Menu menu){  
      super.onPrepareOptionsMenu(menu);  
      return true;  
      }  
  
      public boolean onOptionsItemSelected(MenuItem item){  
      switch(item.getItemId()){  
      case SEARCH_MENU_ID:  
      search();  
      return true;  
      }  
      return true;  
      }  
  
      public void search(){  
      container = (LinearLayout)findViewById(R.id.lLayout1);  
  
      nextButton = new Button(this);  
      nextButton.setText("Next"); 
      nextButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
  
              mWebView.findNext(true); 
              // TODO Auto-generated method stub
  
          }
      });
      container.addView(nextButton);  
  
      closeButton = new Button(this);  
      closeButton.setText("Close");
      closeButton.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
  
  
  
              container.removeAllViews();
              // TODO Auto-generated method stub
  
          }
      });
  
  
      container.addView(closeButton);  
  
      findBox = new EditText(this);  
  findBox.setMinEms(30);  
  findBox.setSingleLine(true);  
  findBox.setHint("Search"); 
  findBox.setOnKeyListener(new OnKeyListener(){  
  public boolean onKey(View v, int keyCode, KeyEvent event){  
  if((event.getAction() == KeyEvent.ACTION_DOWN) &amp;&amp; ((keyCode == KeyEvent.KEYCODE_ENTER))){  
  mWebView.findAll(findBox.getText().toString());  
  
  try{  
  Method m = WebView.class.getMethod("setFindIsUp", Boolean.TYPE);  
  m.invoke(mWebView, true);  
  }catch(Exception ignored){}  
  }  
  return false;  
  }  
  });
  
  
      }
  }
  </code></pre>
  
  <p>*</p>