Skip to content

Instantly share code, notes, and snippets.

@gSrikar
Last active January 16, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gSrikar/a1a95944b6fa5303ce54466e0c8bd6cf to your computer and use it in GitHub Desktop.
Save gSrikar/a1a95944b6fa5303ce54466e0c8bd6cf to your computer and use it in GitHub Desktop.
This gist shows how to solve Resources Not Found Exception especially when implementing CountDownTimer. I've explained about the exception in detail in my blog post http://gsrikar.blogspot.com/2017/01/resources-not-found-exception-in-android.html
new CountDownTimer(10000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
Log.i(TAG, "Time in Milli until finished: " + millisUntilFinished);
int remainingTimeInSec = (int) (millisUntilFinished / 1000);
countDownTimeTextView.setText(String.valueOf(remainingTimeInSec));
}
@Override
public void onFinish() {
Log.i(TAG, "On Finish called");
countDownTimeTextView.setText(String.valueOf(0));
}
}.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment