Code example for Timer

Methods: cancel

0
                    currentText += string.charAt(index);
                    index++;
                } 
 
                if (index >= string.length()) {
                    timer.cancel();
                } else { 
                    currentText += getRandomChar();
                } 
 
                activity.runOnUiThread(new Runnable() {
                    public void run() { 
                        setText(currentText);
                    } 
                }); 
            } 
        }; 
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE