question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What else need for onClick's events?

See original GitHub issue

Hello David, I have some problem’s with onClick events…

  1. Created activity and implements FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener.

  2. Created adapter like this:

public class Adapter extends FlexibleAdapter<AbstractFlexibleItem> {
    public Adapter(@Nullable List<AbstractFlexibleItem> items, @Nullable Object listeners) {
        super(items, listeners, true);
    }
}
  1. Created simple Item object extending AbstractFlexibleItem<Item.ViewHolder> ...
  2. Created instance of this adapter with empty items list like: new Adapter(emptylist, this);
  3. Added some items

Try to fire onClick events, tapping items on the screen… Nothing 😦

What’s wrong?

Thank for help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rusxakepcommented, Jul 12, 2017

I found my mistake. In onBindViewHolder:

    holder.cardview.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
        }
    });

Thank for fast answers. Close issue.

0reactions
davideascommented, Jul 12, 2017

@rusxakep, can you show me the ViewHolder and the Item classes?

Read more comments on GitHub >

github_iconTop Results From Across the Web

onclick Event - W3Schools
The onclick event occurs when the user clicks on an HTML element. See Also: The ondblclick Event · The onmousedown Event · The...
Read more >
HTML Button onclick – JavaScript Click Event Tutorial
The onclick event executes a certain functionality when a button is clicked. This could be when a user submits a form, when you...
Read more >
How to Use the JavaScript onClick Event: A Step-by-Step Guide
This attribute is called onClick. This attribute's value is the code you want to run when the element is clicked.
Read more >
Element: click event - Web APIs | MDN
An element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released...
Read more >
JavaScript onclick event - javatpoint
The onclick event generally occurs when the user clicks on an element. It allows the programmer to execute a JavaScript's function when an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found