sivailango / ExpandableListView-RecylerChildItems

Horizontal Scroll for Child items in ExpandableListView using RecyclerView
61 stars 19 forks source link

OnItemclicklistener #1

Open Shirish8893 opened 8 years ago

Shirish8893 commented 8 years ago

@sivailango Trying to implement OnItemclick. Currently app crashes onItemclick event

xstar97 commented 8 years ago

i used this library...its VERY easy to use

123hidash commented 7 years ago

on child item click not working....help me out please ...

ArunpandiyanMurugesan commented 7 years ago

@123hidash were you able to fix this! .

YangJian1994 commented 7 years ago

How to implement OnItemclick ?

ArunpandiyanMurugesan commented 7 years ago

What I did is, created a transparent overlay button in the call. And for which I have added the onClickListener.

Whenever the button gets the tap, I call a public method of main activity which will take care of any further required actions.

It may not be the nicest one but I made it work.

Code snippet is below for your reference. This goes inside onBindViewHolder of MobileAdapter.java

Button dummyClickButton = (Button) holder.dummyButtonForClick; dummyClickButton.setTag(position); dummyClickButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d("POSITION", view.getTag()+""); ((HomeActivity)context).setSubCategory((Integer)view.getTag()); } });