我正在使用Firebase构建Java应用程序:
void InsertData(){
User user = new User("ABC", "Mumbai");
ref.push().setValue(user, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(DatabaseError error, DatabaseReference ref) {
System.out.println("Value was set. Error = "+error);
System.out.println("Value was set. Done = "+ref);
}
});
}
这是我的代码,数据未插入实时数据库onComeplete
代码未执行。