Coder Social home page Coder Social logo

Comments (8)

rakey avatar rakey commented on July 22, 2024

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.

lakkad-amish avatar lakkad-amish commented on July 22, 2024

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.

johannilsson avatar johannilsson commented on July 22, 2024

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.

rakey avatar rakey commented on July 22, 2024

I didnt find this bug in my project , it runs well . Whats 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.

rakey avatar rakey commented on July 22, 2024

Oh im sorry .I didnt 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.

lakkad-amish avatar lakkad-amish commented on July 22, 2024

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.

rakey avatar rakey commented on July 22, 2024

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.

lakkad-amish avatar lakkad-amish commented on July 22, 2024

no my friend i am from india........

from android-pulltorefresh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.