java - Check enter and leave Preferences -


i'm using preferencefragment , headers manage application settings in official tutorial: http://developer.android.com/guide/topics/ui/settings.html#fragment

you can call preferences actionbar in several activities.

now want detect, if user enters oder leaves preferences. how can that?

my approach using lifecycle methods like: oncreate, onresume, onpause ....

but there solution listener or else?

you can override onbackpressed on preferencefragment call interface method implemented on caller/s activity.

that way can notify need activitys.

public interface preferenceinterface {    public abstract void preferencesclosed();    public abstract void preferencesopened(); } 

i hope looking for.


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -