title: i needed a way to check data, is that exist or not on realtime database
body: <p>i having an qr code layout that been used for opening higher authority activity layout, and how can i make/search the code online on the firebase database that look like below here</p>
  <p><a href="https://i.stack.imgur.com/lYUbp.png" rel="nofollow noreferrer">this what my firebase data look</a></p>
  <p>below this what the code that can open to new activity, but i want the code was different each admin, so if the admin retire i dont need to change the code inside the app everytime</p>
  <pre><code>
  public class BarcodeScanner extends AppCompatActivity {
  
      private CodeScanner mCodeScanner;
      private static final String Code = &quot;newsenyum&quot;;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_barcode_scanner);
          CodeScannerView scannerView = findViewById(R.id.scanner_view);
          mCodeScanner = new CodeScanner(this, scannerView);
          mCodeScanner.setDecodeCallback(new DecodeCallback () {
              @Override
              public void onDecoded(@NonNull final Result result) {
                 BarcodeScanner.this.runOnUiThread(new Runnable() {
                      @Override
                      public void run() {
  
                          String codeFromScanner = result.getText(); // initialize the code from scanner
  
                          if(Code.equals (codeFromScanner.trim ())){
                              redirectToNewActivity ();
                          }else{
                              Toast.makeText (BarcodeScanner.this, &quot;QRCode Tidak Dapat di Gunakan&quot;, Toast.LENGTH_SHORT).show ( );
                          }
                      }
                  });
              }
          });
  
  
          scannerView.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  mCodeScanner.startPreview();
              }
          });
      }
  
  
  
      private void redirectToNewActivity() {
          startActivity (new Intent (getApplicationContext ( ), AdminUID.class));
          finish ( );
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          mCodeScanner.startPreview();
      }
  
      @Override
      protected void onPause() {
          mCodeScanner.releaseResources();
          super.onPause();
      }
  
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/pIExs.png" rel="nofollow noreferrer">this is the code</a></p>