[Solved] android update textview for every 30 seconds [duplicate]


Try this code,

  final Handler h = new Handler();
            h.post(new Runnable() {
                @Override
                public void run() {

                    long millis = (long) currentTime();

                    dateAndTime.setText(getDate(millis, "dd/MM/yyyy hh:mm:ss.SSS"));

                    h.postDelayed(this, 1000);
                }
            });

4

solved android update textview for every 30 seconds [duplicate]