Android - ListView notifyDataSetChanged is calling ACTION_CANCEL on button presses, can I avoid this? -


i'll start out scenario, it's tricky one: have listview single button on each row. these buttons have ability held down user. there chance background thread happen call notifydatasetchanged() on listview. cause action_cancel called on of button presses, interrupting users interaction holding down button.

i've tried couple things, think i've been missing main cause of problem on notifydatasetchanged() action_cancel called on of it's children.

i'm using baseadapter. need update textview next button whenever background thread calls notifydatasetchanged(), can't let interrupt held button. i'm trying manually update text field, it's not redrawing when calling invalidate.

i'll post solution if find one.

figured out! went with. instead of calling notifydatasetchanged() did this.

    int start = list.getfirstvisibleposition();     int end = list.getlastvisibleposition();      (int = start; <= end; i++) {         view view = list.getchildat(i);         if (view != null) {             textview textnotification = (textview) view.findviewbyid(r.id.text_notification);             textnotification.settext("place text here");         }     } 

i found solution here: redraw single row in listview. looks solution worked me well! call new code if 1 of buttons held, else use notifydatasetchanged().


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -