0

I took this method from an activity. How can I add in a Fragment?

@Override
protected void onNewIntent(Intent intent) {
    setIntent(intent);
    readFromIntent(intent);
    if(NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())){
        myTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
    }
}
Termininja
  • 6,620
  • 12
  • 48
  • 49

1 Answers1

0

You can keep a reference to your fragment, so when onNewIntent is called you can call a Fragment's method

firegloves
  • 5,581
  • 2
  • 29
  • 50