title: How to make an NFC tag write protected?
body: <p>I am building a application that writes and reads from NFC tags,but I need the data to be not modified after writing on it.
  I tried MakeReadOnly() ,but I don'tknow why it didn't work ! </p>
  
  <pre><code>     protected void onNewIntent(Intent intent) {
      super.onNewIntent(intent);
      if(intent.hasExtra(NfcAdapter.EXTRA_TAG))
      {
              Toast.makeText(this,"NFC intent!",Toast.LENGTH_SHORT).show();// After detecting a tag on my system, I can get an tag object to write or read from it
              Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
              NdefMessage ndefMessage = creatNdefMessage(StudentId.getText()+"");
              writeNdefMessage(tag,ndefMessage);
          // it writes on the tag but cannot makeit read only !!!
  
         try{ Ndef ndef = Ndef.get(tag);
          if (ndef != null) {
              ndef.connect();
              if (ndef.canMakeReadOnly()) {
                Toast.makeText(this,"can make it read only !",Toast.LENGTH_SHORT).show();
                 ndef.makeReadOnly();
                }
               ndef.close();
            }
        } catch (IOException e) {
           e.printStackTrace();
       }
  
       }
         }
  </code></pre>
  
  <p>In this code, I can check that it accesses the if statement (ndef.canMakeReadOnly()),and this means that the tag can be red only if I call the MakeReadOnly method, but after running it still I can overwrite the tag! </p>
  
  <p>please help ..</p>