Filipe Buhatem Filipe Buhatem - 3 years ago 77
Android Question

How do I click on a button that makes an invisible button appear in android?

I need to do a quiz with levels and I would like the next level button to appear only when a certain button was clicked, how to do it? (Please be detailed, because I'm new to java)

Answer Source

Activity A:

btnA.setOnClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                    Intent i = new Intent(ActivityA.this, ActivityB.class);

Activity B:


public void onCreate(Bundle savedInstanceState) {
    boolean isAnswerCorrect = getIntent().getBooleanExtra("isAnswerCorrect", false);
    if (isAnswerCorrect) {
    } else {


In this case, Activity A is where you are pressing the button and Activity B is the activity you are showing your next level button on,

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download