我正在开发一个简单的安卓应用程序。我通过下面给出的方法设置了偏好 -
public void updateSummaries() {
getPreferenceScreen().findPreference(PREF_SIP_DOMAIN).setSummary(settings.getString(PREF_SIP_DOMAIN, DEFAULT_SIP_DOMAIN));
getPreferenceScreen().findPreference(PREF_SIP_PROXY).setSummary(settings.getString(PREF_SIP_PROXY, DEFAULT_SIP_PROXY));
getPreferenceScreen().findPreference(PREF_SIP_PROXY_PORT).setSummary(settings.getString(PREF_SIP_PROXY_PORT, DEFAULT_SIP_PROXY_PORT));
getPreferenceScreen().findPreference(PREF_STUN_UDP).setSummary(settings.getString(PREF_STUN_UDP, DEFAULT_STUN_UDP));
getPreferenceScreen().findPreference(PREF_STUN_UDP_PORT).setSummary(settings.getString(PREF_STUN_UDP_PORT, DEFAULT_STUN_UDP_PORT));
getPreferenceScreen().findPreference(PREF_STUN_TCP).setSummary(settings.getString(PREF_STUN_TCP, DEFAULT_STUN_TCP));
getPreferenceScreen().findPreference(PREF_STUN_TCP_PORT).setSummary(settings.getString(PREF_STUN_TCP_PORT, DEFAULT_STUN_TCP_PORT));
getPreferenceScreen().findPreference(PREF_TURN_UDP).setSummary(settings.getString(PREF_TURN_UDP, DEFAULT_TURN_UDP));
getPreferenceScreen().findPreference(PREF_TURN_UDP_PORT).setSummary(settings.getString(PREF_TURN_UDP_PORT, DEFAULT_TURN_UDP_PORT));
getPreferenceScreen().findPreference(PREF_TURN_TCP).setSummary(settings.getString(PREF_TURN_TCP, DEFAULT_TURN_TCP));
getPreferenceScreen().findPreference(PREF_TURN_TCP_PORT).setSummary(settings.getString(PREF_TURN_TCP_PORT, DEFAULT_TURN_TCP_PORT));
getPreferenceScreen().findPreference(PREF_TCP_MODE).setSummary(settings.getString(PREF_TCP_MODE, DEFAULT_TCP_MODE));
getPreferenceScreen().findPreference(PREF_AFE_MODE).setSummary(settings.getString(PREF_AFE_MODE, DEFAULT_AFE_MODE));
getPreferenceScreen().findPreference(PREF_BWM_MODE).setSummary(settings.getString(PREF_BWM_MODE, DEFAULT_BWM_MODE));
getPreferenceScreen().findPreference(PREF_HTTP_PROXY).setSummary(settings.getString(PREF_HTTP_PROXY, DEFAULT_HTTP_PROXY));
getPreferenceScreen().findPreference(PREF_HTTP_PROXY_PORT).setSummary(settings.getString(PREF_HTTP_PROXY_PORT, DEFAULT_HTTP_PROXY_PORT));
getPreferenceScreen().findPreference(PREF_HTTP_DOMAIN).setSummary(settings.getString(PREF_HTTP_DOMAIN, DEFAULT_HTTP_DOMAIN));
getPreferenceScreen().findPreference(PREF_TURN_USERNAME).setSummary(settings.getString(PREF_TURN_USERNAME, DEFAULT_TURN_USERNAME));
getPreferenceScreen().findPreference(PREF_TURN_PASSWORD).setSummary(settings.getString(PREF_TURN_PASSWORD, DEFAULT_TURN_PASSWORD));
getPreferenceScreen().findPreference(PREF_HTTP_PROXY_USERNAME).setSummary(settings.getString(PREF_HTTP_PROXY_USERNAME, DEFAULT_HTTP_PROXY_USERNAME));
getPreferenceScreen().findPreference(PREF_HTTP_PROXY_PASSWORD).setSummary(settings.getString(PREF_HTTP_PROXY_PASSWORD, DEFAULT_HTTP_PROXY_PASSWORD));
getPreferenceScreen().findPreference(PREF_TRANSPORT_MODE).setSummary(settings.getString(PREF_TRANSPORT_MODE, DEFAULT_TRANSPORT_MODE));
getPreferenceScreen().findPreference(PREF_AUTO_ANSWER).setSummary(settings.getString(PREF_AUTO_ANSWER, DEFAULT_AUTO_ANSWER));
}
但是这里显示了警告消息,有时我没有在设置页面上设置任何首选项。谁能告诉我这个问题的根本原因是什么?