In my app I have two views, a main and a secondary. However, if my app is paused while in the second view it crashes when the on resume code runs. I discovered that this was because in my on resume has a line where it sets a value to a textview. I would like to encase it in an if statement, but I do not know what phrase I should use to find the content View. Sorry if I am a little unclear - when my user is in secondary view and they close then reopen the app, running the on resume code, it crashes because the text view that the onResume method is trying to modify cannot be accessed.(as it is my main view) and so it crashes.
I know that I could use a try-catch statement, but I also need to find the view in a place in my app where I can't use a try-catch.