I want add social like and contact button on my drawer navigation footer . like this image (http://postimg.org/image/3mcbdod21/) please help me .
Asked
Active
Viewed 1,765 times
-3
-
Please read before posting: http://stackoverflow.com/help/how-to-ask – runDOSrun Mar 17 '15 at 10:15
3 Answers
1
Yes am using android navigation drawer
I add footer in drawer navigation and its look like (http://postimg.org/image/chsryx1qx/)
here is my code footer1.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#7A7A7A"
android:orientation="horizontal"
android:gravity="center">
<ImageView
android:id="@+id/facebook"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/fb"
android:layout_margin="5dp"
/>
<ImageView
android:id="@+id/twitter"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/twitter"
android:layout_margin="5dp"
/>
<ImageView
android:id="@+id/google"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/google"
android:layout_margin="5dp"/>
</LinearLayout>'

Manoj Verma
- 21
- 3
1
footer.java
package com.hdwh.android.wallpaper;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;
import android.content.Intent;
public class Footer extends BaseActivity {
ImageButton imgButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.footer1);
addListenerOnButton();
}
private void addListenerOnButton() {
imgButton = (ImageButton) findViewById
(R.id.facebook);
imgButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String url = "http://www.facebook.com.";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
}
private void addListenerOnButton1() {
imgButton = (ImageButton) findViewById
(R.id.twitter);
imgButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String url = "http://www.twitter.com.";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
}
private void addListenerOnButton2() {
imgButton = (ImageButton) findViewById
(R.id.google);
imgButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String url = "http://plus.google.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
}
}

Manoj Verma
- 21
- 3
0
You can set the layout and set it as layout align parent bottom in the xml file of drawer menu(are you using android navigation drawer?)

Karthika PB
- 1,373
- 9
- 16