0
I am always wanting to check the current time of my device and with this display a notification. But using this code, I can only catch the time I open the app
How can I do this background check, and when I arrive at the given time the app send me the notification.
Thank you in advance
SimpleDateFormat dateFormat_hora = new SimpleDateFormat("HH:mm:ss");
Date data = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(data);
Date data_atual = cal.getTime();
String hora_atual = dateFormat_hora.format(data_atual);
TextView horaatual = (TextView) findViewById(R.id.horaatual);
horaatual.setText(hora_atual);
Behold this
– ramaral