title: How to keep a TextView and a Button invisible after starting an Intent
body: <p>So I have a MainActivity on which I have "Login" button, a "Take Quiz" button and "Not registered? Click here" TextView. If the user logs in, the "Login" button and the TextView go invisible and a "My Account" button becomes visible. Let's say the user decides to log in before taking the quiz. Everything works as it should be - the "Login" button and the TextView go invisible and a "My Account" button becomes visible. After that the user decides to take the quiz, which takes them to another activity. After they take the quiz, they are taken to a third activity - ResultActivity. There is a "menu" item which takes them back to MainActivity with an intent:</p>
  
  <pre><code> @Override
      public boolean onOptionsItemSelected(@NonNull MenuItem item) {
          switch(item.getItemId())
          {
              case android.R.id.home:
                  Intent intent = new Intent(getApplicationContext(), MainActivity.class);
                  startActivity(intent);
                  break;
          }
          return true;
      }
  </code></pre>
  
  <p>And now here is the problem. When the user goes back to MainActivity, instead of "My Account" button, there are the "Log in" button and the TextView to register. How can I keep them invisible and leave the "My Account" button visible?</p>
  
  <p>I should probably use savedInstanceState but I have no idea how because every tutorial online includes only text in an EditText or a Textview. I apologize for the long question.</p>