1

I had created an Android application with Facebook integration of SDK version 4.0+. I implemented a custom Android button in my xml and on click of that button I handle the click of Facebook LoginButton LoginButton loginButton = (LoginButton)findViewById(R.id.login_button); and on click of my custom button I use loginButton.performClick(); And start to work on registercallback function. I had successfully implemented Login feature, but I want that I never logout from my application, until and unless I press the Logout button. So I never want to logout from my application.

Please do me the favour for the same. Any help is appreciated.

upender
  • 99
  • 1
  • 12

1 Answers1

2

use shared preferences or you can also check user is exist or not. you can do like this on your button's click event.

profile = Profile.getCurrentProfile().getCurrentProfile();
if (profile != null) {
 // user has logged in
    LoginManager.getInstance().logOut();
    
} else {
 // user has not logged in
    loginButton.performClick();
}
Harvi Sirja
  • 2,472
  • 2
  • 18
  • 19