forked from kev5/GoMeet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadFromFireBase.java
More file actions
53 lines (53 loc) · 1.88 KB
/
readFromFireBase.java
File metadata and controls
53 lines (53 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//package com.example.meetgo;
//
///**
// * Created by nanto on 10/28/2017.
// */
//import android.util.Log;
//
//import com.google.firebase.database.ChildEventListener;
//import com.google.firebase.database.DataSnapshot;
//import com.google.firebase.database.DatabaseError;
//import com.google.firebase.database.DatabaseReference;
//import com.google.firebase.database.FirebaseDatabase;
//import com.google.firebase.database.ValueEventListener;
//
//import java.util.ArrayList;
//
//import static android.content.ContentValues.TAG;
//
//public class readFromFireBase {
// private DatabaseReference mDatabase;
// private ValueEventListener postListener;
//// private Post postRead;
//// private FirebaseDatabase dataBase;
// private String postText;
//
// public readFromFireBase(String ID) {
// mDatabase = FirebaseDatabase.getInstance().getReference().child("posts").child(ID).child("postText");
// postText = "default"+ID;
//// this.postRead = new Post("","");
// postListener = new ValueEventListener() {
// @Override
// public void onDataChange(DataSnapshot dataSnapshot) {
// // Get Post object and use the values to update the UI
//// Post post = dataSnapshot.getValue(Post.class);
//// postText = post.getPostText();
// postText = dataSnapshot.getValue(String.class);
// // ...
// }
// @Override
// public void onCancelled(DatabaseError databaseError) {
// // Getting Post failed, log a message
// Log.w(TAG, "loadPost:onCancelled", databaseError.toException());
// // ...
// }
// };
// mDatabase.addValueEventListener(postListener);
// }
//
// public String readPostText(){
// return postText;
// }
//
//}