从 EditText 字段中获取文本。并尝试将其设置为新的 CloudObject。但是当我单击按钮时没有任何反应。
btnUpdteStts.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String caption = edtxtPost.getText().toString().trim();
final CloudObject obj = new CloudObject("Status");
try {
obj.set("Cap",caption);
} catch (CloudException e) {
e.printStackTrace();
}
try {
obj.save(new CloudObjectCallback() {
@Override
public void done(CloudObject x, CloudException t) throws CloudException {
if(x!=null) {
Intent goHome = new Intent(Post.this, HomeRoom.class);
startActivity(goHome);
}
}
});
} catch (CloudException e) {
e.printStackTrace();
Toast.makeText(Post.this,"Problem",Toast.LENGTH_LONG).show();
}
}
});