解析为Android:ParseUser.logOut()不记录用户出 [英] Parse for Android : ParseUser.logOut() doesn't log user out
问题描述
我一直在使用Parse玩弄Android上几天,我有ParseUser.logOut()=>一个问题,它实际上并没有将当前用户的。
I've been playing around with Parse on Android for a few days, I have a problem with ParseUser.logOut() => it actually doesn't log the current user out.
下面是我做的:
private void onClickOnDisconnect() {
ParseUser.logOut();
currentUser = ParseUser.getCurrentUser(); // should be null but isn't...
invalidateOptionsMenu();
Toast.makeText(getApplicationContext(), "Disconnected...", Toast.LENGTH_LONG).show();
}
调用后 ParseUser.logOut()
, ParseUser.getCurrentUser()
应该返回null(说文档)。它仍然会返回$ P $用户登录pviously。
即使我重新启动应用程序,用户仍然被认为是连接的。
After the call to ParseUser.logOut()
, ParseUser.getCurrentUser()
should return null (says the documentation). Still it returns the previously logged in user.
Even though I restart the app the user is still considered as connected.
我用解析框架v1.3.8(下载3天前)。我不使用Facebook SDK,因为我已经看到了特定情况下的一些问题。
I use parse framework v1.3.8 (downloaded a 3 days ago). I don't use Facebook SDK, as I've seen a few questions for that specific case.
在此先感谢
推荐答案
我有同样的问题,同时结合注销功能与Facebook登录。该错误被证明很简单,我的一个基本的错误。我写了下面这段code在我的应用程序类
I had the same issue while incorporating logout functionality with facebook login. The error turned out to quite simple and a basic mistake on my part. I had written the following piece of code in my Application class
ParseUser.enableAutomaticUser();
ParseUser.enableAutomaticUser();
这会在用户即使你周围注销你最后一次运行应用程序每次。删除此解决我的问题。
This creates the user every time you run your application even if you have logged out the last time around. Removing this solved my problem.
这篇关于解析为Android:ParseUser.logOut()不记录用户出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!