问题描述
我创造了与Facebook整合的SDK 4.0以上版本的Android应用程序。我在XML实现了自定义的Android按钮,该按钮的点击我处理的Facebook LoginButton LoginButton loginButton =(LoginButton)findViewById(R.id.login_button)的点击;和我的自定义按钮,单击我使用loginButton.performClick();并开始对registercallback功能工作。我已经成功地实施了登录的功能,但我想,我永远不会从我的应用程序退出,直到除非我preSS退出按钮。所以我从来没有想从我的应用程序注销。
请帮我青睐的是一样的。任何帮助是AP preciated。
使用共享preferences或者你也可以检查用户存在与否。
你可以像这样在你的按钮的单击事件。
配置= Profile.getCurrentProfile()getCurrentProfile()。\r
如果(配置文件!= NULL){\r
//用户登录\r
。LoginManager.getInstance()退出();\r
\r
}其他{\r
//用户尚未登录\r
loginButton.performClick();\r
}
\r
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.
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();
}
这篇关于注销功能在Facebook中的Android整合关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!