Skip to content Skip to sidebar Skip to footer

Illegalstateexception (already Attached) When Opening Nfc Reader App

I'm trying to develop an app that reads an NFC tag and displays the read data. I took most of the code from a blog but I'm getting an error when I run the application since I am tr

Solution 1:

You call the onCreate method of the super-class (AppCompatActivity) multiple times in your own onCreate method. Don't do that. super.onCreate() must be called only once (typically this is done at the beginning of your activity's onCreate method. So simply remove the second occurence of

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Post a Comment for "Illegalstateexception (already Attached) When Opening Nfc Reader App"