Android : Storing a NumberPicker result in Parse database

on Friday, April 3, 2015


I have a NumberPicker that needs to be put to a Parse database upon the click of an add button.


I have used the following code to initialise the NumberPicker and store the choice in a variable named 'number'.



pickNo = (NumberPicker) findViewById(R.id.availability);
pickNo.setMaxValue(30);
pickNo.setMinValue(0);
pickNo.setWrapSelectorWheel(false);
number = pickNo.toString();


Then I have tried to put this variable to the Parse database, however it does not display in Parse.



add.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {

if (csgo.isChecked() && pc.isChecked()) {
ParseObject userPosts = new ParseObject("UserPosts");
userPosts.put("Availability", number);
userPosts.saveInBackground();


I have managed to use exactly the same method for a Spinner and Radio Buttons. NumberPickers seem to pose a problem.


0 comments:

Post a Comment