Ho un pulsante e quando lo preme, voglio rimuoverlo (non renderlo invisibile). Ho letto che posso farlo usando layout.removeView(mybutton)
ma qual è il layout? e come posso farlo nella mia attivitàPulsante di rimozione Android in modo dinamico
Button showQuestion;
private void initialize() {
showQuestion = (Button) findViewById(R.id.bAnswerQuestionShowQuestion);
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.bAnswerQuestionShowQuestion:
showQuestion.setVisibility(View.INVISIBLE);
//Here i want to delete the button
question.setVisibility(View.VISIBLE);
theAnswer.setVisibility(View.VISIBLE);
answerQuestion.setVisibility(View.VISIBLE);
showChoices.setVisibility(View.VISIBLE);
showHint.setVisibility(View.VISIBLE);
break;
}
}
Il layout è la vista genitoriale pulsante. –