Button a button unclickabale in Android

Suppose you have five question. when he reached the last question. He definetly submit or click next. on that just pass a boolean variable in Intent if it is in an other Activity.

Intent intent = new Intent(CurrentActivity.this,Destination.class);



getting intent in another activity..

boolean flag = getIntent.getExtra().getBoolean("flag");

//  button.setEnabled(false);


// do other stuff

// to send and recieve boolean

Set intent extra:

Intent intent = new Intent(this, NextActivity.class);
intent.putExtras("yourBoolName", true);

Retrieve intent extra:

protected void onCreate(Bundle savedInstanceState) {
    Boolean yourBool = getIntent().getExtras().getBoolean("yourBoolName");

Leave a Comment