2016-08-04 4 views
0

enter image description hereアンドロイドFirebaseクエリを返す何も

上記の私のfirebaseデータベースです:

-Ideas 
    --Key generated by firebase 
    --uid 
    --name 
    --date 
    --title 

は今、私は特定のUIDによって生成されたすべてのアイデアを取得し、リサイクル業者にクエリを添付する。以下は私のクエリとアダプタですが、何も返しません。

DatabaseReference myIdeasReference = FirebaseDatabase.getInstance().getReference(); 
    final Query myideas =myIdeasReference.child("Ideas")orderByKey().equalTo("userUid",userUid); 
    mAdapter = new FirebaseRecyclerAdapter<Idea, IdeaHolder>(Idea.class, R.layout.listview_feed, IdeaHolder.class, myideas) { 
     @Override 
     public void populateViewHolder(IdeaHolder IdeaViewHolder, final Idea ideaObject, int position) { 
      int voteCountint = ideaObject.getvoteCount(); 
      String voteCount = Integer.toString(voteCountint); 
      int flagCountint = ideaObject.getflagCount(); 
      String flagCount = Integer.toString(flagCountint); 
      String title = ideaObject.gettitle(); 
      String body = ideaObject.getBody(); 
      String postDate = ideaObject.getPostDate(); 
      String mfullName = ideaObject.getfullName(); 
      //pass values :key, Ideauid and Userid to setbutton method in ideaviewholder class 
      DatabaseReference idearef = getRef(position);//get the database reference of the object at selected position 
      final String key = idearef.getKey();//get key of the idea reference to get the location later in mvote and mflag 
      String ideaUid = ideaObject.getuid(); 

P.私はまた、次のクエリを試しました:

 final Query myideas = myIdeasReference.child("Ideas").orderByValue().equalTo("userUid",userUid); 

また、何も表示されませんでした。

答えて

0

これはあなた

myideas = myIdeasReference.child("Ideas").orderByChild("userUid").equalTo(userUid); 
のために働く必要があり、これを試してください
関連する問題