Я перешел по этой ссылке , чтобы прочитать NFC
из тегов, и у меня все получилось, но проблема в том, что я хочу читать NFC
только когда нажимаю кнопку.Итак, в новом намерении я сделал это
@Override
protected void onNewIntent(Intent intent) {
/**
* This method gets called, when a new Intent gets associated with the current activity instance.
* Instead of creating a new activity, onNewIntent will be called. For more information have a look
* at the documentation.
*
* In our case this method gets called, when the user attaches a Tag to the device.
*/
readTag.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
bottomNavigationItemNFC.setVisibility(View.VISIBLE);
handleIntent(intent);
}
});
}
, но все же он читает тег NFC
, прежде чем нажимать кнопку.
Это мой первый вопрос, пожалуйста, извините, если естьлюбые ошибки.ThankYou