android - How to open AlertDialog from preference screen? -


I am developing an application in Android, if I prefer the user to the checkbox from the preferences screen, then show the alert dialog. So how can I do this ..?

override onSharedPreferenceChanged your priority category: / P>

  public class MyPreferences increases priority tools OnSharedPreferenceChangeListener {... shared sharing shared on public (shared shared references, string key) {if (key.equals ("MyCheckboxPreferenceKey") ) {// Show your AlertDialog here! }}    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -