title: getting data from file
body: <p>I made an Android app that  loads a XML file from my website but it just loads the file one time only. I want it to load it as long as the app is running - should I use onResume, or just loop it in "onCreate" method? </p>
  
  <p>Further, what does onResume do?         </p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
  
      while(true) {
  
          DocumentBuilder DB = DBF.newDocumentBuilder();
  
          URL url = new URL("website");
          URLConnection connection = url.openConnection();                     
          Document D =DB.parse(connection.getInputStream());
      }   
  }
  </code></pre>