Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Easy {
- String a ;
- String q ;
- String r ;
- public Easy()
- {
- this.q = "" ;
- this.a = "" ;
- this.r = "" ;
- }
- //getters and setters below
- }
- public void generateData(int index)
- {
- //URL is root url
- final Firebase firebase = new Firebase(FirebaseConfig.URL) ;
- //for the first time index is 1 , then I increment it when I need
- //next query
- //I have not only EasyQuestions child and I have also another
- // severalchilds
- firebase.child("EasyQuestions").
- child(String.valueOf(index)).addValueEventListener(new
- ValueEventListener() {
- @Override
- public void onDataChange(DataSnapshot dataSnapshot) {
- Easy easy = new Easy();
- //I get error below
- easy = dataSnapshot.getValue(Easy.class) ;
- }
- @Override
- public void onCancelled(FirebaseError firebaseError) {
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement