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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -