4
I’m wearing a customview calling for android-spinnerwheel. I inserted her into a listview connected to a CursorAdapter
. If I use the OnitemClickListener
from Listview, the cursor goes to the corresponding position of the list and everything looks beautiful... but, if I use the onChanged
of this view to update a hashmap with the value of this customview corresponding to the registry key on the cursor, as the cursor does not change its pointer... and returns me the wrong key.
In the CursorAdapter
was 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);
}
});
The logcat returns me the wrong record.
How to force the cursor to go to the correct position when executing this Onchanged
, preferably without "tags"?
onChanged of which View? Without the code becomes complicated.
– Neto Marin
"I’m using a customview called android-spinnerwheel."
– AnselmoMS