androidandroid-cursorandroid-cursoradapter

Android - How to get position in bindView like in getView?


In getView() of CursorAdapter, there's a parameter position so I can do a checking for that position, how can I do the same on bindView() it has no position parameter in BindView.

Currently I'm overriding newView(), bindView() and getView() which I read and heard is bad, either override getView() OR newView() and getView().

Thanks.


Solution

  • Try this

    public void bindView(View arg0, Context arg1, Cursor arg2)
    {
        int pos = arg2.getPosition();
    }