简体   繁体   中英

listen for Preference button click in Main Activity

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM