I'm using a customview call android-spinnerwheel . I inserted it into a listview linked to a CursorAdapter
. If I use the OnitemClickListener
of the ListView, the cursor goes to the corresponding position in the list and it looks beautiful ... but if I use onChanged
of this view to update a hashmap in> with the value of this customview corresponding to the registry key in the cursor, as the cursor does not change its pointer ... and returns me the wrong key.
No CursorAdapter
looks like this:
public class AdapterlistaPessoapub extends CursorAdapter {...
public void BindView (View view, Context context, Cursor cursor) {...
SpinQtde.addChangingListener (new OnWheelChangedListener ()
{
@ Override
public void onChanged (AbstractWheel wheel, int oldValue, int newValue) {
PessoapubActivity.items.put(getCursor().getInt(getCursor().getColumnIndex(constants.FPESSOAPUB_CODPUBLICACAO)), newValue);
Log.i (GetCursor () getString (GetCursor () getColumnIndex (constants.FvPESSOAPUB_NOMEPUBLICACAO)) + "", "New value:.." + NewValue);
}
});
Logcat returns the wrong record.
How to force the cursor to go to the correct position when executing this Onchanged
, preferably without "tags"?