Created
June 13, 2013 15:56
-
-
Save iraSenthil/5774870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void resetUi(){ | |
| runOnUiThread(new Runnable() { | |
| @Override | |
| public void run() { | |
| button.setVisibility(View.VISIBLE); | |
| webView.setVisibility(View.GONE); | |
| } | |
| }); | |
| } | |
| private void displayTotalWalkingDistance(double totalWalkingDistanceMiles) { | |
| final String milesWalkedMessage = (totalWalkingDistanceMiles < 1) ? "0 miles?, You get no respect, Start walking already!!!" : | |
| String.format("Cool, You have walked %.2f miles so far.", totalWalkingDistanceMiles); | |
| displayToast(milesWalkedMessage); | |
| resetUi(); | |
| } | |
| private void displayToast(final String message) { | |
| runOnUiThread(new Runnable() { | |
| @Override | |
| public void run() { | |
| Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show(); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment