title: Android - screen orientation reloads activity
body: <p>im going to re-ask this question because there is SO much bad information out there its really depressing. the short story is that i dont want anything to change or happen when the device orientation changes. 2 of the most popular "solutuions" given to this problem are:</p>
  
  <p>1.You could lock the activity in one orientation by addingandroid:screenOrientation="portrait" (or "landscape") to  in your manifest. </p>
  
  <p>2.You could tell the system that you meant to handle screen changes for yourself by specifying android:configChanges="screenOrientation" in the  tag. This way the activity will not be recreated, but will receive a callback instead (which you can ignore as it's not useful for you).</p>
  
  <p>NEITHER of those work. so let me explain my particular problem in more detail...</p>
  
  <p>i am experimenting with a VERY simple app as a learning exercise. i have a text file on a server. the text file has 1 thing in it: a single integer on a single line. this number is the number of image files also stored on this server, and the images are all named 0.jpg, 1.jpg, 2.jpg etc.</p>
  
  <p>ALL of my code is in the onCreate method of my activity (like i said its a simple app).</p>
  
  <p>the app does the following when it runs:</p>
  
  <p>reads the number from the text file.
  generate a random number from zero to the number in the file.
  loads a random image into an imageview by using the random number in the URL.</p>
  
  <p>when the screen rotates i do not want all of that to happen again. i simply want NOTHING to happen... except that the screen should obviosuly rotate and the image should scale to fit, which it does. but every time the screen rotates all of that code runs and a new random image is selcted. can someone please give me a simple solution with the working code to fix this? i learn by seeing so if you cant provide a code example it wont help.</p>
  
  <p>thanks in advance.</p>
  
  <p>ps... im not looking for a different way of doing what im doing, thats not the point. im looking to FIX the way im currently doing it.</p>