Here is the 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 that extend "Activity" and couple of others extend listActivity. For the classes, extending Activity, I can just extend the "MyBaseActivity" and call the method as:
@Override
public void onUserInteraction()
{
resetDisconnectTimer();
}
But what about for the classes that extending listactivity ? Any ideas how we can solve it ??
You can switch to fragments so:
Then you some of your subclasses of
BaseActivity
have aListFragment
in them. To make the porting easier assignid
of@android:id/list
to thatListFragment
.