Code example for NumberPicker

Methods: getValuesetValue, setVisibility

0
	        }); 
    } 
     
    /* Makes the number picker and score text visible on retry */ 
    public void onRetry(){ 
    	np.setVisibility(0);
    	scoreCount.setVisibility(0);
    } 
 
    /* Reinitializes all the values for score and makes the win text and picture invisible 
     * while making the number picker's value set to 0. 
     * Also restarts the timer for the ducks*/ 
    public void doOnCreate(){ 
    	score = 0;
        retryButton.setVisibility(4);
        winDog.setVisibility(4);
        winText.setVisibility(4);
         
         
		scoreCount.setText("Score: " + Integer.toString(score));
		np.setValue(0);
		speed = np.getValue();
		t = new Timer();
		task = new Task();
		t.schedule(task, 2000 - (speed * 250), 2000 - (speed * 250));
    }