Support for IllegalArgumentException: No view found for id in fragments in Android Java

IllegalArgumentException that suddenly came up I will post for the first time. I usually make android apps by personal development.

I recently got a job as an engineer, so I'm going to Shibuya and others from July next month. I plan to work. Nice to meet you.

Well, I crushed it for about an hour with this error, so share it.

It was caused by onCreate (savedInstanceState) With my code,

From super.onCreate (savedInstanceState); Change to super.onCreate (null);

It was solved by doing.

It was the login screen part at startup, but it seems that the loading of the bundle was not successful.

If the code goes through with this change, It's not a problem because savedInstanceState is unnecessary and activity is regenerated firmly.

Reference Understand the Activity Lifecycle https://developer.android.com/guide/components/activities/activity-lifecycle

stackoverflow:"IllegalArgumentException: No view found for id in fragments" https://stackoverflow.com/questions/28637046/illegalargumentexception-no-view-found-for-id-in-fragments

Recommended Posts

Support for IllegalArgumentException: No view found for id in fragments in Android Java
[Android / Java] Screen transition and return processing in fragments
View current date in Java
Try implementing Android Hilt in Java
Rock-paper-scissors game for beginners in Java
[For beginners] Run Selenium in Java
Settings for SSL debugging in Java