我已經嘗試過使用線程,但它不成功,使用EditText作爲輸入改變TextView文本後,textView沒有改變。請幫幫我!如何在Android中持久更改TextView文本?
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
//shared is SharedPreferences object that I define as an instance variable
String inp = shared.getString("input", def);
textView.setText(inp);
Log.d("input",inp);
});
thread.start();
你能解釋一下你想要做什麼? –