-1
mySpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
data ="";
String splithis;
splithis=mySpinner.getSelectedItem().toString();
splited = splithis.split(" ");
course = splited[0];
sections = splited[2];
new Thread(new Runnable() {
public void run() {
data = bw.getAttendanceFromDB(term, course,sections,day);
runOnUiThread(new Runnable() {
@Override
public void run() {
ArrayList<Properties> attendanceusers = attendanceUse(data);
addAttendance(attendanceusers);
}
});
}
}).start();
}
我有ArrayList attendanceusers填充我的動態設計,它正在學生的出席和數據庫中動態填充我的設計。但是,每當有其他學生進來時,它並不會動態地反映這種變化。刷新正在發生,如果我點擊另一個日期,但我想要的是它每5秒或10秒刷新一次。即時通訊試圖研究堆棧中的答案,但所有的答案都不同於我的答案。如何刷新每5秒鐘內線程中的runOnUiThread?
有沒有runOnUiThread(新的Runnable()在你的建議重複 – picolo
我正在尋找的是刷新runOnUiThread – picolo
是這個Android或其他東西嗎?Eclipse是用來開發各種Java,你需要告訴我們正是你正在使用的框架/ GUI –