title: Android : App crashes when there is no file to load, how do i over come this?
body: <p>My app crashes when it tryes to load a file that isnt there. how do i stop it from loading the file when there isnt a file but when there is a file of that name it does load it.</p>
  
  <p>Here is the code I am using to load the file. Any comments would be appreciated :) </p>
  
  <p>Cheers</p>
  
  <pre><code>    try {
          fis = openFileInput(FILENAME1);
          byte[] dataArray = new byte[fis.available()];
          while (fis.read(dataArray) != -1){
              task1 = new String(dataArray);
  
          }
  
      } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      finally {
          try {
              fis.close();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  </code></pre>