I have connected my android app with firebase realtime database. It successfully retrieves data from the database and project through an activity, which is RecyclerView showing a CardView Layout. Now, when I select a specific CARD a DIALOG should pop up showing all the data of that specific firebase node only to the dialog layout.
I need to get the pushID (as 'selectedKey' variable) of that selected CARD and call the Dialog, which shows the data from firebase by retrieving again from the database with that 'KEY' string... Or is there any other simple way...?
I have also illustrated what I want to do.
connected firebase database showing the node
app activity and dialog layout
<holder.setItemClickListener(new ItemClickListener() {
@Override
public void onClick(View view, int position) {
selectedArticle = model;
selectedKey = getSnapshots().getSnapshot(position).getKey();
Log.d("Key item", ""+selectedKey);
showArticle.setContentView(R.layout.show_article_dialog);
show_article_title.setText(model.getTitle());
show_article_tag1.setText(model.getTag1());
show_article_tag2.setText(model.getTag2());
show_article_tag3.setText(model.getTag3());
show_article_content.setText(model.getContent());
articleBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showArticle.dismiss();
}
});
showArticle.show();>