I've implemented onUserInteraction() method in Activity preference and working like a charm. But when custom dialog box open, onUserInteraction() does not get fired. I have googled lots of sites, but couldn't figure out the proper way. Here is my simple snippet:
@Override
public void onUserInteraction() {
    super.onUserInteraction();
    resetTimer();
}
 
    