Back to project page mtgtools.
The source code is released under:
GNU General Public License
If you think the Android project mtgtools listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pe.apiconz.apps.mtgtools; //from w w w . j av a2 s. co m import android.app.Activity; import android.os.Bundle; import android.widget.NumberPicker; public class CounterActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_counter); super.onCreate(savedInstanceState); NumberPicker numberPicker = (NumberPicker) findViewById(R.id.numberPicker1); String[] numberArray = new String[60]; populateNumberArray(numberArray); numberPicker.setMinValue(0); numberPicker.setMaxValue(numberArray.length - 1); numberPicker.setDisplayedValues(numberArray); numberPicker.setValue(40); numberPicker .setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS); getActionBar().setDisplayHomeAsUpEnabled(true); } private void populateNumberArray(String[] numberArray) { int count = -20; for (int i = 0; i < numberArray.length; i++) { numberArray[i] = "" + count; count++; } } }