At the information level, I'm not going to work by opening an activity, I'll do that How do I edit a child on firebase? and delete childs.
public class BloviewHolderr extends RecyclerView.ViewHolder{
View mView;
ImageButton mMenuPopup;
Context mContext;
private DatabaseReference mDatabase1;
public BloviewHolderr(View itemView) {
super(itemView);
mView = itemView;
mMenuPopup = (ImageButton) mView.findViewById(R.id.menuComentario);
mMenuPopup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mContext = mView.getContext();
PopupMenu popup = new PopupMenu(mContext, mMenuPopup);
//Inflando o popup usando o arquivo xml
popup.getMenuInflater().inflate(R.menu.menu_comentarioo, popup.getMenu());
//Resgata o item clicado e mostra em um Toast
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.apagar:
Intent singleBlogIntent = new Intent (Comentarios.this, FloatChat.class);
startActivity(singleBlogIntent);
// read the listItemPosition here
// read the listItemPositionForPopupMenu here
return true;
default:
return false;
}
}});
popup.show();;
}
});
}