Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:21:32+00:00 2026-06-15T14:21:32+00:00

In my app I have two views, a main and a secondary. However, if

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:21:34+00:00Added an answer on June 15, 2026 at 2:21 pm

    I solved my problem by keep in an int value at zero whilst in one view, and whenever the view is switched, I changed the value of that int to one. Then in my onResume, if that ints == 1, then I don’t set the value of my edittext, but if that int == 0, then I know that it is safe to call the setText() method

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that has a centre view with two views off to
I have a main view screen with navcontroller in my app with two UIbuttons.
I have two backbone Views. One is the main view and the other is
I have a view, which is having two sub views, while adding those two
In my iPhone app, I have a view controller with two views (essentially, a
I have an app with two view controllers. ViewControllerA is a blank view with
So I have two TableView in one view of an iOS app. I have
I have two views. The User view has some text and a button. I
We are creating an app with two main views: sView and sViewSettings. If the
I have a main window which hosts two views (user controls). One is UserControl1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.