title: setContentView over and setting ImageView force close
body: <p>So basically the screen has a GridView with 9 images on it. When one of those images clicks I have it setContentView to open a layout of just an image view so it displays the chosen image. After they are done with that image they will click back and it gets rid of that contentView and displays the GridView again. The majority of that works except for it using the ImageView in the other contentView. </p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setView();
      setContentView(R.layout.wall);
  
  
      GridView gridview = (GridView) findViewById(R.id.gridview);
      gridview.setAdapter(new ImageAdapter(this));
  
      gridview.setOnItemClickListener(new OnItemClickListener() {
         @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position,
                  long arg3) {
              pos = position;
              displayWallpaper();
  
  
          }
      });
  }
  
  private void displayWallpaper(){
          switch(pos){
          case 0: 
              setContentView(R.layout.wallpaper);
              viewing=true;
          ImageView image1 = (ImageView)findViewById(R.id.display);
          rotate(R.drawable.wallpaper1, image1);
              break;
  }
  }
  </code></pre>
  
  <p>So the force close is happening at the ImageView line. And my guess is it isn't finding display, but display is in the wallpaper layout. Any ideas why it may be force closing. If you need more info let me know what and if you have a better way of doing what I am trying to make happen let me know. Thanks.</p>
  
  <p>Also just tested it out. So far the force close still happens if rotate() is commented out and ImageView is there. If I comment both out it works fine (apart from displaying the image).</p>