title: How to make a button press once and wait until the second button is pressed and viceversa
body: <p>Hello this is my code in android studio.</p>
  
  <pre><code>public class GroupDesign extends AppCompatActivity {
      private static final String TAG = "Spectrum Inc";
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_group_design);
  
          //button do suf
  
                  Button lock = (Button) findViewById(R.id.lockit);
                  //set what happens when pressed
                  lock.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View view) {
                          Log.i(TAG, "This is a secure message!");
                          Toast.makeText(getApplicationContext(), "Door Locked!", Toast.LENGTH_SHORT)
                                  .show();
  
                      }
                  });
                    Button unlock = (Button) findViewById(R.id.unlockit);
                  //set what happens when pressed
                  unlock.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View view) {
                          Log.i(TAG, "This is a secure message!");
                          Toast.makeText(getApplicationContext(), "Door Unlocked!", Toast.LENGTH_SHORT)
                                  .show();
                      }
                  });
  
  
          }
      }
  </code></pre>