Restoring buttons back to its position <p>I searched stackoverflow for answers buy am unable to find one so i am posting a question.A helping hand is much appreciated.</p> <p>I am creating a quiz app.The layout contains six textview box and 12 buttons with letters.when user clicks on button textview gets filled with each letter and increments textview based on position so that all six textview box gets filled.i have also made buttons to disappear as soon as the text gets filled in textview.i am successful in implementing these steps but my question is how to make filled textview text empty so that the corresponding button gets reappeared?to be more clear i added onClickListener to textview but filled text in textview doesn't decrement. hope you have understand the question .i am still learning and am developing app from scratch.</p> <pre><code>switch(v.getId()) { case R.id.button1: { b1=(Button) findViewById(R.id.button1); String name1=b1.getText().toString(); tv.setText(name1); position++; b1.setVisibility(View.INVISIBLE); } break; case R.id.button2: b2=(Button) findViewById(R.id.button2); String name2=b2.getText().toString(); //blankbut.setText(name2); tv.setText(name2); position++; b2.setVisibility(View.INVISIBLE); break; case R.id.button3: b3=(Button) findViewById(R.id.button3); String name3=b3.getText().toString(); tv.setText(name3); //blankbut.setText(name3); position++; b3.setVisibility(View.INVISIBLE); break; case R.id.button4: b4=(Button) findViewById(R.id.button4); String name4=b4.getText().toString(); tv.setText(name4); //blankbut.setText(name4); position++; b4.setVisibility(View.INVISIBLE); break; case R.id.button5: b5=(Button) findViewById(R.id.button5); String name5=b5.getText().toString(); tv.setText(name5); //blankbut.setText(name5); position++; b5.setVisibility(View.INVISIBLE); break; case R.id.button6: b6=(Button) findViewById(R.id.button6); String name6=b6.getText().toString(); tv.setText(name6); //blankbut.setText(name6); position++; b6.setVisibility(View.INVISIBLE); break; case R.id.button7: b7=(Button) findViewById(R.id.button7); String name7=b7.getText().toString(); tv.setText(name7); // blankbut.setText(name7); position++; b7.setVisibility(View.INVISIBLE); break; case R.id.button8: b6=(Button) findViewById(R.id.button8); String name8=b8.getText().toString(); tv.setText(name8); //blankbut.setText(name8); position++; b8.setVisibility(View.INVISIBLE); break; case R.id.button9: b9=(Button) findViewById(R.id.button9); String name9=b9.getText().toString(); tv.setText(name9); //blankbut.setText(name9); position++; b9.setVisibility(View.INVISIBLE); break; case R.id.button10: b10=(Button) findViewById(R.id.button10); String name10=b10.getText().toString(); tv.setText(name10); //blankbut.setText(name10); position++; b10.setVisibility(View.INVISIBLE); break; case R.id.button11: b11=(Button) findViewById(R.id.button11); String name11=b11.getText().toString(); tv.setText(name11); //blankbut.setText(name11); position++; b11.setVisibility(View.INVISIBLE); break; case R.id.button12: b12=(Button) findViewById(R.id.button12); String name12=b12.getText().toString(); tv.setText(name12); //blankbut.setText(name12); position++; b12.setVisibility(View.INVISIBLE); break; } </code></pre>