title: Is it ok to use setContentView() once in OnResume()
body: <p>I have heard things about how it is bad to use <code>setContentView()</code></p>
  
  <p><a href="https://stackoverflow.com/questions/4757418/pattern-one-activity-multiple-views-advantages-and-disadvantages/4758715#4758715">Pattern &quot;One activity, multiple views&quot;: Advantages and disadvantages</a></p>
  
  <p>However I was wondering, would it be unlikely that my application will cause memory leaks, if I use <code>setContentView()</code> once in the <code>onResume()</code> method of my activity?</p>
  
  <p>Whenever the user opens my app, it checks to see if something has been enabled in settings. If it has been enabled then the app uses a different screen compared to the original screen.</p>
  
  <p>Therefor my code looks like this:</p>
  
  <pre><code> @Override
      protected void onResume() {
         super.onResume();
         InputMethodManager im = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
         String list = im.getEnabledInputMethodList().toString();
         if(Stuff is true){
          setContentView(R.layout.activityscreen_enabled);
         }
     }
  
  }
  </code></pre>
  
  <p>Would using <code>setContentView()</code> be unlikely to cause memory leaks and other such problems? Or is there a better solution?</p>