android - 解析服务器如何在 logInWithInBackground 后获取 AuthenticationCallback?
问题描述
调用 logInWithInBackground 后如何获得回调?目前我正在使用下面的代码进行登录,但不知道如何获得成功结果。
Task<ParseUser> parseUserTask = ParseUser.logInWithInBackground("facebookaccountkit", authData);
我想在成功登录后将用户发送到另一个活动。
api链接:
https://parseplatform.org/Parse-SDK-Android/api/com/parse/AuthenticationCallback.html
解决方案
您可以使用延续:
parseUserTask.continueWith(new Continuation<ParseUser, Void>() {
@Override
public Void then(bolts.Task<ParseUser> task) {
if(task.isCancelled()){
showError();
return null;
}
if (task.isFaulted()){
showError();
return null;
}
final ParseUser user = task.getResult();
//do something with the user
return null;
}
});
推荐阅读
- reactjs - 如何直接在jsx“src”中发出http请求
- python - 删除 pandas 数据框中 2 列中包含重复值的行
- bash - 无法从 $ 获得正确的退出代码?
- linux - udpsink 似乎没有流任何东西,但 fileink 工作
- gis - 在 Repast Simphony 中读取并显示 1 个或多个光栅文件
- python - AttributeError: 'StringVar' 对象没有属性 'encode'
- javascript - 如何使 SELECT 标记更改 URL
- postgresql - 如何在运行的 docker-compose 容器中使用 /var/run/docker.sock?
- php - 我想从数据库中查询注册号是用来登录的?
- javascript - 从另一个数组中存在的对象数组中删除对象