@Override
protected
void
onResume() {
super
.onResume();
if
(thread ==
null
) {
thread =
new
Thread() {
@Override
public
void
run() {
try
{
while
(
true
) {
synchronized
(
this
) {
Thread.sleep(
60000
);
runOnUiThread(
new
Runnable() {
@Override
public
void
run() {
refresh();
}
});
}
}
}
catch
(InterruptedException e) {
e.printStackTrace();
}
}
};
thread.start();
}
if
(Globals.getCurrentNextDate(
0
,
"EE"
).equals(
"토"
)) {
CurrentNextDate(
2
,
3
,
4
,
5
,
6
);
}
else
if
(Globals.getCurrentNextDate(
1
,
"EE"
).equals(
"토"
)) {
CurrentNextDate(
0
,
3
,
4
,
5
,
6
);
}
else
if
(Globals.getCurrentNextDate(
2
,
"EE"
).equals(
"토"
)) {
CurrentNextDate(
0
,
1
,
4
,
5
,
6
);
}
else
if
(Globals.getCurrentNextDate(
3
,
"EE"
).equals(
"토"
)) {
CurrentNextDate(
0
,
1
,
2
,
5
,
6
);
}
else
if
(Globals.getCurrentNextDate(
4
,
"EE"
).equals(
"토"
)) {
CurrentNextDate(
0
,
1
,
2
,
3
,
6
);
}
else
if
(Globals.getCurrentNextDate(
5
,
"EE"
).equals(
"토"
)) {
CurrentNextDate(
0
,
1
,
2
,
3
,
4
);
}
}
public
void
CurrentNextDate(
int
day1,
int
day2,
int
day3,
int
day4,
int
day5) {
tv_day1.setText(Globals.getCurrentNextDate(day1,
"M월 dd일 (EE)"
));
tv_day2.setText(Globals.getCurrentNextDate(day2,
"M월 dd일 (EE)"
));
tv_day3.setText(Globals.getCurrentNextDate(day3,
"M월 dd일 (EE)"
));
tv_day4.setText(Globals.getCurrentNextDate(day4,
"M월 dd일 (EE)"
));
tv_day5.setText(Globals.getCurrentNextDate(day5,
"M월 dd일 (EE)"
));
}
public
void
refresh() {
ll_day1.removeAllViews();
ll_day2.removeAllViews();
ll_day3.removeAllViews();
ll_day4.removeAllViews();
ll_day5.removeAllViews();
fnLoadCalendar();
db_update();
}