I read your question, I already ran into this problem, and I made my own code for it without using a third-party library.
Here is the code:
public class CountDownTimerDaysActivity extends AppCompatActivity { private TextView months_left,weeks_left,daysLeft,hrsLeft,minLeft,secLeft,endDate; private Handler handler; private String endDateTime="2019-03-21 10:15:00"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_count_down_timer); initView(); } private void initView() { months_left = findViewById(R.id.months_left); weeks_left = findViewById(R.id.weeks_left); daysLeft = findViewById(R.id.days_left); hrsLeft = findViewById(R.id.hrs_left); minLeft = findViewById(R.id.min_left); secLeft = findViewById(R.id.sec_left); endDate = findViewById(R.id.end_date); endDate.setText(endDateTime); countDownStart(); } public void countDownStart() { handler = new Handler(); Runnable runnable = new Runnable() { @SuppressLint("SetTextI18n") @Override public void run() { handler.postDelayed(this, 1000); try { @SuppressLint("SimpleDateFormat") SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
I hope his work is for you
source share