i am new to android ....
i have designed a view where i have created 4 image buttons
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
but i dont know how to configure the button to send a url and the page must inside the same design view shown below
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/apple" >
<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" />
<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" />
<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" />
<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" >
</TableLayout>
<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" />
<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" />
<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" />
<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" /></RelativeLayout>
the above code looks like this if i click on facebook image then it has to populate this link https://www.facebook.com/apple.fruit
And link has to populate onto body (shown in image)
can anyone write the backend code how to use the button
i have created one java file
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;
} }
Can anyone please resolve the code if any queries please comment