New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting wrong position of the clicked item? #14
Comments
Try |
Yes, But can you tell me why this happens so? |
Like
|
Hello, liaohuqiu! I try to use id, but every time i got a 0. Position of selected item changed from device to device with change of columns count. @OverRide
Selected item with position 5, with id 0 |
@PankovSerge sorry for replying so late. Is the |
Got this issue when use header view. I use a custom adapter extended from BaseAdapter, and got it working by use id instead of position. @Override
public long getItemId(int position) {
return position;
} One more problem with onClick Handler, if you don't setup it like that footerView.setOnClickListener(this);
} you have got error in @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
} because footerView have position > yourSource.size(). Need to add this moments to README. |
I have attached a click listener but getting incorrect position when a particular grid item is clicked. My code is as follows:
Can you tell me where I am going wrong?
The text was updated successfully, but these errors were encountered: