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/92ec5a4c4a78cb21e1cd4ed7657262d8 to your computer and use it in GitHub Desktop.
Save gSrikar/92ec5a4c4a78cb21e1cd4ed7657262d8 to your computer and use it in GitHub Desktop.
This gist shows when a Resources Not Found Exception is thrown 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(remainingTimeInSec);
}
@Override
public void onFinish() {
Log.i(TAG, "On Finish called");
countDownTimeTextView.setText(0);
}
}.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment