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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -