0
我正在開發一個簡單的android應用程序。我已經通過給出如下─爲什麼顯示「方法getPreferenceOnScreen已被分解」?
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));
}
但這裏是顯示警告信息,有時我不明白設置頁面上設置的任何偏好的方法設置首選項。任何人都可以告訴我,這個問題的根源是什麼?
感謝....解決它...... –
'getPreferenceManager()'現在已經過時了。有沒有新的選擇? – MEX