How to set Facebook Logout button at the end of navigation

I implemented facebook login via facebook sdk 4.3. I made a separate fragment of the dialog to enter facebook. So far, everything is working very well.

What I want I want to implement the Facebook exit button at the bottom of my navigation view to get logged out, but I have no idea how to implement it. Because I implemented the facebook login via the facebook login button. and I saw this button after logging in to go to the facebook exit button. Now i want two things

  • How to insert a button in the navigation view How I made navigation by viewing a new design technique and what I have ever added to it is the navigation menu. So I have no idea how to add a button to it

  • Secondly, I don’t know how to exit facebook using my own or custom button. what function should i implement

What I was looking for so far, they get the final exit session, which now does not exist on facebook new sdk. So I have no idea how to implement it separately

In order for you to allow me to enter the code so that you know how I implemented my navigation mode

this one is in my main xml for navigation.

<android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_height="match_parent" android:layout_width="wrap_content" android:layout_gravity="fill_vertical|left" app:menu="@menu/drawer" app:itemTextColor="#ffffff" android:background="#AF4B02" app:itemIconTint="@color/navigation_icon" android:fadingEdge="horizontal"/> 

and this is my box item in the menu folder

 <group android:checkableBehavior="single"> <item android:id="@+id/home" android:checked="false" android:icon="@drawable/drawer_ic_home" android:title="@string/home_string" /> <item android:id="@+id/offer" android:checked="false" android:icon="@drawable/drawer_ic_offer" android:title="@string/offer_string" /> <item android:id="@+id/share" android:checked="false" android:icon="@drawable/drawer_ic_share" android:title="@string/share" /> <item android:id="@+id/take" android:checked="false" android:icon="@drawable/drawer_ic_take" android:title="@string/take" /> <item android:id="@+id/offer_status" android:checked="false" android:icon="@drawable/drawer_ic_status" android:title="@string/offer_status" /> <item android:id="@+id/about_us" android:checked="false" android:icon="@drawable/drawer_ic_about_us" android:title="@string/about_us_string" /> </group> 

so now in navigation mode I want to add a button at the bottom of the navigation view. Tell me how to do this? how to listen to his click event, and then on this click How to log out of facebook?

Please, help.

+5
source share
1 answer

This is how I add a button at the bottom of the navigation view

 <android.support.design.widget.NavigationView android:id="@+id/navigation_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:background="@color/white" app:headerLayout="@layout/navigation_view_header" app:itemIconTint="@drawable/navigation_selector_text" app:itemTextColor="@drawable/navigation_selector_text" app:menu="@menu/side_navigation_menu_login"> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <FacebookButton android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"> </FacebookButton> </RelativeLayout> </android.support.design.widget.NavigationView> 
+8
source

All Articles