0
如何更改首選項屏幕的TextEdit的值,我想要修改MainActivity的TextEdit。我該怎麼做?。改變preferenceScreen的textEdit時如何設定值微調器?
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
if (key.equals(PrefUserName)) {
SharedPreferences sharedPref = PreferenceManager
.getDefaultSharedPreferences(getApplication());
String textoEditTextPreference = sharedPref.getString(key,
"");
// Spinner spinner = (Spinner) findViewById(R.layout.activity_main);
//Here I want add value spinner of main activity...
// Spinner spinner = (Spinner) findViewById(R.layout.activity_main);
Toast.makeText(
getApplication(),
"New name of user: "
+ textoEditTextPreference, Toast.LENGTH_SHORT)
.show();
}
嗨,你能解決您的一個評論那裏identation,這是代碼? – 2014-09-20 12:20:06