我知道,如果我想创建一个新行,我必须在\n需要创建该行的任何位置插入。但我得到的是没有我在 firebase 数据库中已有的行的文本。有人可以告诉我如何解决这个问题吗?例如,如果我在数据库中有 hello \n world。我明白hello world了 当我真的应该得到它时
hello
world
Run Code Online (Sandbox Code Playgroud)
我需要更改 firebase 或源代码中的某些内容吗?
这就是我从 firebase 获取数据的方式
private void getData(){
firebaseDatabaseInstance = FirebaseDatabase.getInstance();
// get reference to 'users' node
booksInstance = firebaseDatabaseInstance.getReference("monzmat");
books.clear();
books.addAll(db.getAllBookMonzmat());
adapter = new qamoosAdapter(this, books);
gridView.setAdapter(adapter);
booksInstance.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
storeData(dataSnapshot);
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException());
}
});
booksInstance.orderByChild("id").addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot …Run Code Online (Sandbox Code Playgroud)