0
Hello, so it’s no longer the first time I’ve been having trouble with Recyclerview.Viewholder, in this case now happens the following, My menu has 2 buttons I’m trying to catch the click with switch (item.getItemId()) I really don’t know if this is the right more when I try to do something simple like open an activity I can’t get since it asks to put the Viewh as, not Static, then no apparent error appears more when I run the app soon appears the error java.lang.Nosuchmethodexception: class android.view.View ... I tried to put in a separate class but then came other problems that didn’t solve either. I don’t know if I was clear enough with the question if not, ask me if I add something.
At information level, I’m not going to work opening Victoria, I’ll do it How I Edit a Child in firebase? and erase 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();;
}
});
}
It has as you put your menu_comentarioo.xlm?
– viana
how it works to put some action in the click, I was trying to open an activity and could not, then tried to do a simple action in firebase also could not
– Wallace Roberto
I don’t think clicking on the way I’m doing public Boolean onMenuItemClick(Menuitem item) { switch (item.getItemId()) { case R.id.delete:
– Wallace Roberto
From what I can see, the click on the item is working perfectly. Check it out: I took the Intent and put a Toast https://drive.google.com/open?id=0BxfzFAS7MTC0bktGNmdFNVRVOHM
– viana
then it must be the intention since even the Toast I could not use
– Wallace Roberto
when I try to use an intention that opens an activity Activity appears highlighted and when I try to solve apprece to take out Static(public Static class Bloviewholderr extends Recyclerview.Viewholder{) so if I do this error activity after (java.lang.Nosuchmethodexception: class android.view.View)
– Wallace Roberto
Let’s go continue this discussion in chat.
– viana