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();
}
I have ArrayList attendanceusers that populates my dynamic design, it is getting the attendance of students in the database and populating my design dynamically. However whenever another students come in, it doesn't reflect the change dynamically. The refresh is happening if im clicking another date, but what i want is for it to refresh for every 5 secs or 10 secs. im trying to research the answers here in stack but all the answers are different from mine.