title: I'm trying to retrieve a file that is stored in internal storage on an Android device but I can't find it
body: <p>I have written a file to internal storage. It shows up in my "data/data/package-name/file folder. It exists when I check in this directory. But in the code below, when I type File file = new File(fileName), file.exists() comes up false. Can anyone tell me why?</p>
  
  <pre><code>fileName = "match." + mMatchID + ".json";
  
  Log.d(TAG1, "Filename: " + fileName);   // the file name is ok
  
  
  File file = new File(fileName);
  
  Log.d(TAG1, "Does File Exist: " + file.exists());
  
  Gson gson = new Gson();
  
  
  if (file.exists()) {
      // read file into memory and assign the string to matchString
      BufferedReader reader = null;
      try {
          reader = new BufferedReader(new FileReader(fileName));
          matchString = reader.readLine();
  
          Log.d(TAG1, "When you read the match back into memory: " + matchString);
  
  
      } catch (IOException e) {
          e.printStackTrace();
  
          Log.d(TAG1, "an error occured:" );
      } finally{
          try {
              assert reader != null;
              reader.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  
      match = gson.fromJson(matchString, Match.class);
  }
  
  
  match.setMatchName(mMatchNameEditText.getText().toString());
  match.setMatchLevel(mSpinner.getSelectedItem().toString());
  
  // convert match back to JSON
  matchString = new Gson().toJson(match);
  
  FileOutputStream fos = null;
  
  try {
      fos = openFileOutput(fileName, MODE_PRIVATE);
      fos.write(matchString.getBytes());
  } catch (IOException e) {
      e.printStackTrace();
  } finally {
      try {
          assert fos != null;
          fos.close();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  
  Toast.makeText(EditMatchActivity.this, "Match Updated", Toast.LENGTH_SHORT).show();
  }
  
  SharedPreferences.Editor editor = getSharedPreferences(MY_GLOBAL_PREFS, MODE_PRIVATE).edit();
  editor.putString(CURRENT_MATCH_NAME, mMatchNameEditText.getText().toString());
  String level = mSpinner.getSelectedItem().toString();
  editor.putString(CURRENT_MATCH_LEVEL, level);
  editor.apply();
  </code></pre>
  
  <p>Here is the evidence in the stack trace:</p>
  
  <pre><code>08-22 14:17:50.674 2883-2883/com.checkinsystems.ez_score D/EditMatchActivity: Filename: match.08222017PGA5614023.json
  08-22 14:17:50.674 2883-2883/com.checkinsystems.ez_score D/EditMatchActivity: Does File Exist: false
  08-22 14:17:50.703 2883-3109/com.checkinsystems.ez_score D/EGL_emulation: eglMakeCurrent: 0x7f92842e1d20: ver 2 0 (tinfo 0x7f92842c2f00)
  08-22 14:17:50.710 2883-3109/com.checkinsystems.ez_score D/EGL_emulation: eglMakeCurrent: 0x7f92842e1d20: ver 2 0 (tinfo 0x7f92842c2f00)
  08-22 14:17:52.684 2883-3109/com.checkinsystems.ez_score E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f92842e25e0
  </code></pre>