第二天
完善了发布动态和更改个人标签的功能
测试还有一些缺陷,可以发空动态,后面会限制关键词和内容
部分重要函数
Button btn_submit = findViewById(R.id.btn_submit);
btn_submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
BmobQuery<Bean> b = new BmobQuery<Bean>();
b.addWhereEqualTo("Phone", phone);
b.findObjects(new FindListener<Bean>() {
@Override
public void done(List<Bean> object, BmobException e) {
if (e == null) {
if (object.size() > 0) {
Bean bean = new Bean();
bean.Sex=one;
bean.Age=two;
bean.Interest=three;
bean.Game=four;
bean.Music=five;
bean.Movie=six;
bean.Sport=seven;
bean.Read=eight;
bean.Character=nine;
bean.update(object.get(0).getObjectId(), new UpdateListener() {
@Override
public void done(BmobException e) {
if (e == null) {
Toast.makeText(MatchScreen.this,"提交成功!",Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MatchScreen.this, Match.class);
intent.putExtra("phone", phone);
intent.putExtra("id", id);
startActivity(intent);
finish();
}
}
});
}
}
}
});
}
});
}