title: Android write ID to an empty NFC tag
body: <p>I made an app that reads NFC tags, but I face the issue that not all bands have an ID.</p>
  
  <p><strong>Is it possible to assign a new ID to an empty tag?</strong></p>
  
  <pre><code>private String tagInfoId = "";
  private NfcAdapter nfcAdapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.dialog_player);
      if (!userPrefs.isLoggedIn().get()) finish();
      trackerService = ServiceGateway.createAuthorizedService(TrackerService.class);
  
      nfcAdapter = NfcAdapter.getDefaultAdapter(this);
      if (nfcAdapter == null) {
          Toast.makeText(this,
                  "NFC NOT supported on this devices!",
                  Toast.LENGTH_LONG).show();
          finish();
      } else if (!nfcAdapter.isEnabled()) {
          Toast.makeText(this,
                  "NFC NOT Enabled!",
                  Toast.LENGTH_LONG).show();
          finish();
      }
  }
  
  @Override
  protected void onResume() {
      super.onResume();
  
      Intent intent = getIntent();
      String action = intent.getAction();
      if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)) {
          Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
          if (tag == null) {
              Log.d(TAG, "tag == null");
  
              //here is possible to write a new tag code ???
  
          } else {
              byte[] tagId = tag.getId();
              for (int i = 0; i &lt; tagId.length; i++) {
                  tagInfoId += Integer.toHexString(tagId[i] &amp; 0xFF);
              }
              Log.d(TAG, "onResume() called with: " + "tagID:" + tagInfoId);
  
          }
      }
  }
  </code></pre>
  
  <p><strong>Manifest.xml</strong></p>
  
  <pre><code>   &lt;activity
              android:name=".activities.NfcActivity"
              android:noHistory="true"
              android:theme="@android:style/Theme.Translucent.NoTitleBar"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.nfc.action.TAG_DISCOVERED" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  </code></pre>
  
  <p>Also, if I assign an ID to a new tag, will it read it in the same way or do I have to change the above code?</p>