java - Overriding notifyDataSetChanged() not working -
i'm trying override notifydatasetchanged call super.notifydatasetchanged, want force happen on main ui thread.
i have
@override public void notifydatasetchanged() { activity.runonuithread(new runnable() { @override public void run() { super.notifydatasetchanged(); } }); }
but error the method notifydatasetchanged() undefined type object
. causing , proper fix?
assuming adapter class structured this:
public class myadapter extends baseadapter { private activity mactivity; public myadapter(activity activity) { super(activity); mactivity = activity; } @override public void notifydatasetchanged() { mactivity.runonuithread(new runnable() { @override public void run() { super.notifydatasetchanged(); } } } }
at point call super.notifydatasetchanged()
, you're in context of new anonymous runnable
class, calling super
trying find superclass of runnable; not adapter, you're expecting.
you need qualify you're looking adapter
class's superclass:
mactivity.runonuithread(new runnable() { @override public void run() { myadapter.super.notifydatasetchanged(); } }
Comments
Post a Comment