【发布时间】:2015-11-28 11:34:28
【问题描述】:
我正在一个添加关注/关注系统的 android 应用程序中工作,我正在使用 Parse.com 中的行,我有一个用户个人资料,当我点击关注按钮时,应用程序会发送两个用户id(当前用户和其他用户)连续。我正在使用指向 _user 类的指针。
这是我当前的代码:
Intent i = get intent();
String userId = i.getStringExtra("userid");
ParseObject follow = new ParseObject("Follow");
follow.put("from",ParseUser.getCurrentUser());
follow.put("to", userId);
follow.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
btn_follow.setImageDrawable(getResources().getDrawable(R.drawable.ic_following));
}
});
The btn_follow change the image. which means the following has been done. but my Follow class is empty.
我已将我的关注表从: ...|从|到| 到 : ...|从|到|
这很好,两个用户 id 都保存了,但我需要指针而不是字符串,所以我再次放置 from 和 to 指针并删除了该行
follow.put("to", userId);
这也很有效,但它只保存了当前用户,而不是我试图关注的用户。 所以我的问题是我想关注的用户的 ID。 他们在指南中说
"ParseUser otheruser = ..."
(我不知道在 3 点中输入什么来获取另一个用户 ID)
【问题讨论】:
标签: android pointers parse-platform