qq_38423382
qq_38423382
2017-09-23 08:16

为啥这个Toast一直是显示的红色的

  • bmob
  • app
  • 数据
  • java
  • android-studio

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());
            }
        }
    });
}

}

图片说明

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐