Android - switching between landscape and portrait mode makes Intent lose values
I am using Intents to switch between activities in my Android app. I am putting data in the Intent for use in the next activity. When I switch the phone between landscape and portrait modes, the values passed from the intent are lost and I get a NullPointerException. Can someone please tell me what could be wrong. There's a lot of code to post it entirely. But if someone needs to look at specific parts of code, I can post it here. Edit I solved the issue of state not being saved. But another problem I faced is that none of the buttons on the screen work after the orientation has been changed.