-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 –