Code example for NumberPicker

Methods: setContentDescriptionsetMaxValuesetMinValue

0
 
		CheckBox chkMobileData = new CheckBox(this);
		chkMobileData.setText("Activate Mobile Data automatically");
		chkMobileData.setContentDescription("Activate Mobile Data to send the location and turn off again");
		 
		NumberPicker periodicity = new NumberPicker(this);
		periodicity.setContentDescription("Defines the frequency that the location is send (in minutes)");
		periodicity.setMinValue(0);
		periodicity.setMaxValue(60);
		 
		Button btnActivate = new Button(this);
		btnActivate.setText("Activate");
		 
		LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.VERTICAL);
        layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
		layout.addView(txt);
		layout.addView(chkWifi);
		layout.addView(chkMobileData);
		layout.addView(periodicity);
Connect your IDE to all the code out there  Get Codota for Java