title: How to add url link to ImageButton in android
body: <p>I have an android web-view app in which i have added some ImageButtons, and now i want to add url links to that ImageButton, link should open with app in webview. following are my codes</p>
  
  <p>image_button.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:weightSum="1"
      android:layout_above="@+id/adView"&gt;
  
      &lt;ImageButton
      android:id="@+id/image_button1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:src="@drawable/_button"
          android:clickable="true"
          style="@style/Widget.AppCompat.Button"
         /&gt;
      &lt;ImageButton
          android:id="@+id/image_button2"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:src="@drawable/image_button"
          style="@style/Widget.AppCompat.Button"
          /&gt;
      &lt;ImageButton
          android:id="@+id/image_button3"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:src="@drawable/image_button"
          style="@style/Widget.AppCompat.Button"
          /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>ImageButton.java</p>
  
  <p>public class ImageButton extends AppCompatActivity {</p>
  
  <pre><code>DrawerLayout drawerLayout;
  ActionBarDrawerToggle drawerToggle;
  NavigationView navigation;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.image_button);
      initInstances();
  }
  public void image_button1 (View view) {
      goToUrl ( "http://google.com/");
  }
  
  public void image_button2 (View view) {
      goToUrl ( "http://google.com/");
  }
  
  private void goToUrl (String url) {
      Uri uriUrl = Uri.parse(url);
      Intent WebView = new Intent(Intent.ACTION_VIEW, uriUrl);
      startActivity(WebView;
  }
  </code></pre>