Comments (8)
You can print the position in the method.Did you use the wrong param? the param type long or int ?
2014-01-16
Rakey Zhao
发件人:Amish Patel [email protected]
发送时间:2014-01-16 17:32
主题:[android-pulltorefresh] Listview on ItemClick gives wrong position (#76)
收件人:"johannilsson/android-pulltorefresh"[email protected]
抄送:
When i click on item position it gives wrong position.for example i am clicking on position no 2 the it give the value of position 3.let me know how can i resolve this issue please
—
Reply to this email directly or view it on GitHub.
from android-pulltorefresh.
01-16 16:21:38.635: I/System.out(11122): ------------ Position int ::1
01-16 16:21:38.635: I/System.out(11122): ------------ Position long ::48
01-16 16:21:38.635: I/System.out(11122): ------------ Product Id ::52
i have print log but on zero position it gives 1 poition
from android-pulltorefresh.
I believe this is by design since it is using a header view which will take up one position in the list. I believe your best option is to provide your own ids of the list that you feed through your adapter instead.
from android-pulltorefresh.
I didnt find this bug in my project , it runs well . What
s your OS version?
2014-01-17
Rakey Zhao
发件人:Amish Patel [email protected]
发送时间:2014-01-16 18:55
主题:Re: [android-pulltorefresh] Listview on ItemClick gives wrong position (#76)
收件人:"johannilsson/android-pulltorefresh"[email protected]
抄送:"rakey"[email protected]
01-16 16:21:38.635: I/System.out(11122): ------------ Position int ::1
01-16 16:21:38.635: I/System.out(11122): ------------ Position long ::48
01-16 16:21:38.635: I/System.out(11122): ------------ Product Id ::52
i have print log but on zero position it gives 1 poition
—
Reply to this email directly or view it on GitHub.
from android-pulltorefresh.
Oh im sorry .I didn
t use this widget in my project. I review the source. You are right. The auther used the position 0 as refresh view,. Then, set the selection at position 1 when the listView show . you can see the source. @OverRide protected void onAttachedToWindow() { super.onAttachedToWindow(); setSelection(1); //here } @OverRide public void setAdapter(ListAdapter adapter) { super.setAdapter(adapter); setSelection(1); // here override the method setAdapter }
My solution is very easy. In the method change the value of param
public void onItemClick(AdapterView<?> arg0, View view, int arg2,
long arg3) {
// arg2 is the position you can use (arg2 - 1)
}
2014-01-17
Rakey Zhao
发件人:Amish Patel [email protected]
发送时间:2014-01-16 17:32
主题:[android-pulltorefresh] Listview on ItemClick gives wrong position (#76)
收件人:"johannilsson/android-pulltorefresh"[email protected]
抄送:
When i click on item position it gives wrong position.for example i am clicking on position no 2 the it give the value of position 3.let me know how can i resolve this issue please
—
Reply to this email directly or view it on GitHub.
from android-pulltorefresh.
yes i find the way.i have write click event on view in adapter and remove listview onitemclick event.now its working good.
from android-pulltorefresh.
Are you American?
2014-01-20
Rakey Zhao
发件人:Amish Patel [email protected]
发送时间:2014-01-17 21:34
主题:Re: [android-pulltorefresh] Listview on ItemClick gives wrong position (#76)
收件人:"johannilsson/android-pulltorefresh"[email protected]
抄送:"rakey"[email protected]
yes i find the way.i have write click event on view in adapter and remove listview onitemclick event.now its working good.
—
Reply to this email directly or view it on GitHub.
from android-pulltorefresh.
no my friend i am from india........
from android-pulltorefresh.
Related Issues (20)
- PullToRefreshListView的GridView,分页时,下一页如果只有一个数据不能马上显示,需要稍微往上拖动下,再往下拖动才可显示出数据,是怎么回事呢? HOT 2
- Tap to refresh always showing HOT 3
- How to set Typeface of text in list HOT 6
- Pull the bottom HOT 1
- Throwing an Exception in this Demo HOT 2
- mLastMotionY not correctly set HOT 2
- expandable list view HOT 1
- scroll problem HOT 1
- Lag when pulling, (lazy loading image).
- NullPointer when clicking on list items HOT 1
- Works only with linked list HOT 4
- Pull to refresh effect is not working HOT 1
- How to show pull-to-refresh automatically? HOT 3
- Sometimes getting tap to refresh HOT 2
- failed to disable Tap to refresh HOT 1
- Boundary instability issue
- Fast scrolling jump to first visible row
- Possible to add "Load More" button at footer view to loat more data?
- the activity will crashed when I pull to refresh crazily HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-pulltorefresh.