package com.example.a23734.myapplication;
import cn.bmob.v3.Bmob;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;
import android.*;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bmob.initialize(this, "11c28913956ce3efb4ae4edffb0bce01");
Person p2 = new Person();
p2.setName("lucky");
p2.setAddress("北京海淀");
p2.save(new SaveListener<String>() {
@Override
public void done(String objectId,BmobException e) {
if(e==null){
toast("添加数据成功,返回objectId为:"+objectId);
}else{
toast("创建数据失败:" + e.getMessage());
}
}
});
}
}