Code example for NfcAdapter

Methods: enableForegroundDispatch

0
                .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP|
                          Intent.FLAG_ACTIVITY_CLEAR_TOP);
      PendingIntent pi=PendingIntent.getActivity(this, 0, i, 0);
       
      inWriteMode=true;
      nfc.enableForegroundDispatch(this, pi, tagFilters, null);
    } 
  } 
   
  @Override 
  public void onPause() { 
    if (isFinishing()) {
      nfc.disableForegroundDispatch(this);
      inWriteMode=false;
    } 
     
    super.onPause(); 
  } 
   
  private byte[] buildUrlBytes(String url) {
Stop searching for code, let great code find you!  Add Codota to your java IDE