Ben Richard
Lurker
What I am trying to do is get user input as a editText and output it to that amount so if the user enters 9 it outputs 9 textbox
here is the code:
questionAndTimer class:
public void onClick(View view) {
//Create Intent object which moves from QuestionAndTimer class
//to SendQuestion class
Intent intObj = new Intent(QuestionAndTimer.this, SendQuestion.class);
//Set the user entered question in value name which will be
//used in GreetingActivity class
intObj.putExtra("HOW", name2);
//Start sendQuestion
startActivity(intObj);
if (howManyQuestions != null && howManyQuestions.getText().length() != 0) {//check if user enters a numeric attribute
name2 = howManyQuestions.getText().toString();
}
else if(howManyQuestions.getText().toString().isEmpty()) {//check if user doesn't enter a numeric attribute
Toast.makeText(this, "please enter how many answers you are looking for..", Toast.LENGTH_SHORT).show();
return ;
}
sendQuestion class:
String howMany = (String) intename.getSerializableExtra("HOW");
if(howMany == "9") {
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
}
here is the code:
questionAndTimer class:
public void onClick(View view) {
//Create Intent object which moves from QuestionAndTimer class
//to SendQuestion class
Intent intObj = new Intent(QuestionAndTimer.this, SendQuestion.class);
//Set the user entered question in value name which will be
//used in GreetingActivity class
intObj.putExtra("HOW", name2);
//Start sendQuestion
startActivity(intObj);
if (howManyQuestions != null && howManyQuestions.getText().length() != 0) {//check if user enters a numeric attribute
name2 = howManyQuestions.getText().toString();
}
else if(howManyQuestions.getText().toString().isEmpty()) {//check if user doesn't enter a numeric attribute
Toast.makeText(this, "please enter how many answers you are looking for..", Toast.LENGTH_SHORT).show();
return ;
}
sendQuestion class:
String howMany = (String) intename.getSerializableExtra("HOW");
if(howMany == "9") {
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
answers.setText("" + howMany);
}