title: how to link the image button to a facebook page in android
body: <p>i am new to android ....</p>
  
  <p>i have designed a view where i have created 4 image buttons </p>
  
  <p>in that one has to go to facebook url
          second has to go twitter url
          third has to go to youtube url etc like that
          fourth to linkedin </p>
  
  <p>but i dont know how to configure the button to send a url and the page must inside the same design view shown below</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@drawable/apple" &gt;
  
  
  
  &lt;Button
      android:id="@+id/main"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="#2C3539"
      android:gravity="center"
      android:text="@string/apple"
      android:textColor="#FFFFFF"
      android:textSize="22sp" /&gt;
  
  &lt;Button
      android:id="@+id/video"
      android:layout_width="match_parent"
      android:layout_height="55dp"
      android:layout_alignParentBottom="true"
      android:layout_alignParentRight="true"
      android:layout_toRightOf="@+id/music"
      android:background="#2C3539"
      android:text="@string/video"
      android:textColor="#FFFFFF"
      android:textColorHint="@color/black"
      android:textSize="20sp" /&gt;
  
  &lt;Button
      android:id="@+id/music"
      android:layout_width="160dp"
      android:layout_height="55dp"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:background="#2C3539"
      android:text="@string/music"
      android:textColor="#FFFFFF"
      android:textColorHint="@color/black"
      android:textSize="20sp" /&gt;
  
  &lt;TableLayout
      android:id="@+id/tableLayout1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/main"
      android:layout_marginLeft="41dp"
      android:layout_marginTop="72dp" &gt;
  
  &lt;/TableLayout&gt;
  
  &lt;ImageButton
      android:id="@+id/twitter1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/facebook1"
      android:src="@drawable/twitter" /&gt;
  
  &lt;ImageButton
      android:id="@+id/facebook1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/main"
      android:src="@drawable/facebook" /&gt;
  
  &lt;ImageButton
      android:id="@+id/youtube1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/twitter1"
      android:src="@drawable/youtube" /&gt;
  
  &lt;ImageButton
      android:id="@+id/instagram1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_below="@+id/youtube1"
      android:src="@drawable/instagram_icon" /&gt;&lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>the above code looks like this if i click on facebook image then it has to populate this link 
  <a href="https://www.facebook.com/apple.fruit" rel="nofollow noreferrer">https://www.facebook.com/apple.fruit</a></p>
  
  <p><img src="https://i.stack.imgur.com/Qeyym.jpg" alt="enter image description here"></p>
  
  <p>And link has to populate onto body (shown in image)</p>
  
  <p>can anyone write the backend code how to use the button </p>
  
  <p>i have created one java file </p>
  
  <pre><code>package com.lay.background;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.Menu;
  
  
  
  
  
  
  
  
  
  public class AppleActivity extends Activity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.apple);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.second, menu);
          return true;
      }   }
  </code></pre>
  
  <p>Can anyone please resolve the code if any queries please comment </p>