Im using a settings activity with a preference.xml to create a settings menu. Im trying to listen to a button click from my settings activity in my main activity. I cant seem to figure out how to accomplish this?
您应该通过使用SharedPreferences#registerOnSharedPreferenceChangeListener()监听SharedPreferences
更改来做到这一点。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.