I have an application which in turn can call another application. In this second application the user can do some actions and the data is then returned to my main application. Everything works fine until the user goes into the second application and instead of doing the expected flow, presses the back button.
This will throw a null pointer exception in my OnActivityResult method in my main application because of course there is no data.
How do you handle something like this? Also, I do not have access to the second applications code so my application is just calling a third party piece of software.
I would check if the variable in question is null, if it is don’t try to access it.
If that is not an option, you will need to provide some context preferably by posting samples of the relevant code because I can only guess at the current circumstances.