protected
void
onResume() {
this
.overridePendingTransition(
0
,
0
);
super
.onResume();
Thread thread =
new
Thread(
new
Runnable(){
@Override
public
void
run(){
try
{
Thread.sleep(
100
);
}
catch
(Exception e){
e.printStackTrace();
}
runOnUiThread(
new
Runnable(){
@Override
public
void
run() {
try
{
Thread.sleep(
100
);
}
catch
(Exception e){
e.printStackTrace();
}
final
TextView timertxt01 = (TextView) findViewById(R.id.TimerView01);
final
TextView timertxt02 = (TextView) findViewById(R.id.TimerView02);
Calendar c = Calendar.getInstance();
final
int
Year = c.get(Calendar.YEAR);
int
Month = c.get(Calendar.MONTH);
int
Day = c.get(Calendar.DAY_OF_MONTH);
final
int
DayOfWeek = c.get(Calendar.DAY_OF_MONTH);
int
Hour = c.get(Calendar.HOUR_OF_DAY);
int
Minute = c.get(Calendar.MINUTE);
final
int
Second = c.get(Calendar.SECOND);
final
int
AmPm = c.get(Calendar.AM_PM);
String stringDayOfWeek[] = {
""
,
"일"
,
"월"
,
"화"
,
"수"
,
"목"
,
"금"
,
"토"
};
String stringAmPm[] = {
"오전"
,
"오후"
};
Month = Month+
1
;
String str_Month =
""
;
String str_Day =
""
;
String str_Hour =
""
;
String str_Minute =
""
;
if
(Month <
10
){
str_Month =
"0"
;
}
else
{
str_Month =
""
;
}
if
(Day <
10
){
str_Day =
"0"
;
}
else
{
str_Day =
""
;
}
if
(Hour <
10
){
str_Hour =
"0"
;
}
else
{
str_Hour =
""
;
}
if
(Minute <
10
){
str_Minute =
"0"
;
}
else
{
str_Minute =
""
;
}
timertxt01.setText(Year +
"."
+ str_Month + Month +
"."
+ str_Day + Day);
timertxt02.setText(str_Hour + Hour +
" : "
+ str_Minute + Minute);
}
});
}
});
thread.start();
}