解决:铃声改变,来短信,短信设置中默认铃声的名称没有同步更新

时间:2021-09-02 00:52:34

短信界面没有关闭的情况下,在设置中进行操作,短信设置界面中不会进行刷新。因此在当MessagingPreferenceActivity处于活动(onResume)的时候重新初始化,添加代码如下:


    protected void onResume() {
        super.onResume();
         loadPrefs();

        // Since the enabled notifications pref can be changed outside of this activity,
        // we have to reload it whenever we resume.
        setEnabledNotificationsPref();
        // Initialize the sms signature
        updateSignatureStatus();
        registerListeners();
        boolean airplaneModeOn = isAirplaneModeOn();
        // Caused by the ICC card state maybe changed outside of this activity,
        // we need to update the state of the SMSC preference.
        updateSMSCPref(ALL_SUB, airplaneModeOn);
    }