我正在使用PreferenceActivity,我需要使用方法getSupportFragmentManager()
來顯示一個對話框。我有這樣在PreferenceActivity中使用getSupportFragmentManager
myClassDialog dia = new myClassDialog();
dia.show(getSupportFragmentManager(), null);
的Eclipse代碼給了我這個錯誤:
The method
getSupportFragmentManager()
is undefined for the type newPreference.OnPreferenceClickListener(){}
我怎樣才能解決這個問題?
[Call Dialog:Not working on API 10](http://stackoverflow.com/questions/20523119/call-dialog-not-work-on-api-10) – Nfear
另請參閱:http:/ /stackoverflow.com/questions/7922906/is-it-possible-to-launch-a-dialogfragment-from-a-preference-in-a-preferenceactiv –
你剛纔問了這個34分鐘前(http://stackoverflow.com的/ questions/20523119/call-dialog-not-work-on-api-10)問題並得到答案。爲什麼不花一些時間嘗試自己找到解決方案並學習? – Emmanuel