title: Android app says the file does not exist but it does. I need to install it
body: <p>Here is my code:</p>
  
  <pre><code>        String dir = getFilesDir().getAbsolutePath();
          File myFile = new File(dir+"/file.apk");
  
          if (myFile.exists())
          {
              textView.setText("File exists.");
          }
          else
          {
              textView.setText("File does not exist.");
          }
  </code></pre>
  
  <p>myFile.exists() is false. I do not know why. The file exists and it is located in the directory.</p>
  
  <p>When I solve the problem, I'll try this:</p>
  
  <pre><code>            Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
              intent.setData(Uri.fromFile(myFile));
              intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);
              intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              startActivity(intent);
  </code></pre>
  
  <p>Can somebody help? Why it does not see the file?</p>
  
  <p>UPDATE:</p>
  
  <p>It's really strange. If I use code: </p>
  
  <pre><code>            if (myFile.exists())
              {
                  textView.setText("it exists");
              }
              else
              {
                  textView.setText(myFile.getAbsolutePath());
              }
  </code></pre>
  
  <p>, it goes to 'else' and shows the path to the file which 'does not exist'.</p>