나는이 응용 프로그램을 만들어 지금은 다른 활동 시작될 때까지 초를 표시 할 텍스트 뷰를 사용하고 싶어하지만, 나는 countdowntimer 내부 txtview을 만들었지 만 그것 Countdowntimer 텍스트 뷰
Event=new String(Edt.getText().toString());
final int time = Integer.parseInt(sec.getText().toString());
Intent myInt = new Intent(MainActivity.this,Receiver.class);
myInt.putExtra("key",Event);
endingIntent pendingIntent = PendingIntent.getActivity(MainActivity.this,2,myInt,PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+(time*1000),pendingIntent);
new CountDownTimer(time*1000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
// TODO Auto-generated method stub
txtV.setText("Activity starts"+millisUntilFinished/1000+"seconds"); // here is the txtV which isn't shown
}
@Override
public void onFinish() {
// TODO Auto-generated method stub
}
};
를 보여준 적이 방법을 모른다
'CountDownTimer'를 시작하는 것은 어떻습니까? –