PreferenceActivity: using onSharedPreferenceChanged()

前端 未结 1 565
迷失自我
迷失自我 2021-01-27 10:10

So basically I have a PreferenceActivity that I use to make calls to a Web Service through private classes extending AsyncTask. Whenever a Preference changes I have a \"huge\" \

相关标签:
1条回答
  • 2021-01-27 10:36

    To answer your first question, if you don't want to deal with using a big switch/case statement your best bet would be to extends the preferences you are using. For instance if you are using a ton of checkbox's just extend the checkbox preference and add your logic to overridden methods. In my experience this cuts way back on code and makes the logic very easy to follow. You can see the original source at grepcode.com if you need to understand how something is working or need to "hack" something in.

    0 讨论(0)
提交回复
热议问题