- Forum posts: 5
Nov 16, 2015, 6:53:14 AM via Website
Nov 16, 2015 6:53:14 AM via Website
I have this android application which VoteActivity.class create custom questionnaire and send it tovoteAnswer.class to check the radio button and answers the questionnaire. I am trying to havevoteAnswer.class to send the answer to the sender's email address. The answers should be send to whoever created the questionnaire in the first place which can be any email. In other words, the user will be getting the answers in his/her email address. I tried fetching the email from parse.com database but it is not working. Do I need to be parse pro member? Or How how does that work? Or am I doing it wrong? I have been struggling with this small matter for few weeks and I would really be grateful if I received hints from experts here in Androidpit to clear my confusion
query.findInBackground( new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
if (e==null) {
for (int i = 0; i <objects.size(); i ++)
{
String question = objects.get(0).getString("questionare");
final String mO = objects.get(0).getString("optionOne");
final String mT = objects.get(0).getString("optionTwo");
final String mH = objects.get(0).getString("optionThree");
questionare = (TextView) findViewById(R.id.mainQ);
mOne = (TextView) findViewById(R.id.optionO);
mTwo = (TextView) findViewById(R.id.optionTW);
mThree = (TextView) findViewById(R.id.optionTH);
radioVoteGroup = (RadioGroup) findViewById(R.id.radioGroup1);
optionONE=(RadioButton) findViewById(R.id.optionone);
optionTWO=(RadioButton) findViewById(R.id.optiontwo);
optionTHREE=(RadioButton) findViewById(R.id.optionthree);
//questionare.setText(objects.get(i).getString("questionare"));
// mOne.setText(objects.get(i).getString("optionOne"));
// mTwo.setText(objects.get(i).getString("optionTwo"));
// mThree.setText(objects.get(i).getString("optionThree"));
questionare.setText(question);
optionONE.setText(mO);
optionTWO.setText(mT);
optionTHREE.setText(mH);
//mOne.setText(mO);
// mTwo.setText(mT);
// mThree.setText(mH);
Log.d("questionare", "Retrieved " + objects.size()+ " questionare");
mButton =(Button) findViewById (R.id.Submit);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
returnVoteAnswer();
}
});
}
//question = objects.toString("questionare");
//mO = objects.toString("optionOne");
// mT = objects.toString("optionTwo");
// mH = objects.toString("optionThree");
//addData();
}
else
{
e.printStackTrace();
}
}
});
}
private String returnVoteAnswer ()
{
switch (radioVoteGroup.getCheckedRadioButtonId()) {
case R.id.optionone:
return optionONE.getText() .toString();
case R.id.optiontwo:
return optionTWO.getText().toString();
case R.id.optionthree:
return optionTHREE.getText().toString();
default:
return "";
}
}
Thanks in advance
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.