java - Call a method of "Activity extended" class from "ListActivity extended" -
here snippet of "mybaseactivity" class.
public class mybaseactivity extends activity { public void resetdisconnecttimer() { disconnecthandler.removecallbacks(disconnectcallback); disconnecthandler.postdelayed(disconnectcallback, disconnect_timeout); } @override public void onuserinteraction() { resetdisconnecttimer(); } }
my app contains many classes extend "activity" , couple of others extend listactivity. classes, extending activity, can extend "mybaseactivity" , call method as:
@override public void onuserinteraction() { resetdisconnecttimer(); }
but classes extending listactivity ? ideas how can solve ??
you can switch fragments so:
class myactivity extends mybaseactivity { @override protected void onuserinteraction() {..} } class mybaseactivity extends fragmentactivity { protected void onuserinteraction() {...} }
then of subclasses of baseactivity
have listfragment
in them. make porting easier assign id
of @android:id/list
listfragment
.
Comments
Post a Comment