title: File not found Exception in Android but File Exists
body: <p>I am trying to get the address of any file on android and then read its content.</p>
  
  <p>I am getting the location of file as :</p>
  
  <pre><code>uri2.toString() gives string "file:///storage/emulated/0/download/user.txt"
  
  uri2.getEndodedPath() gives string "/storage/emulated/0/download/user.txt"
  </code></pre>
  
  <p>when passing these value to file it gives file not found exception</p>
  
  <p><strong>Note : I am not reading file from sdcard or asset folder or raw folder and i am testing my app on mobile one plus cyanogen mod</strong></p>
  
  <p>here is my android code</p>
  
  <pre><code>    import android.app.Activity;
  import android.content.Intent;
  import android.net.Uri;
  import android.nfc.Tag;
  import android.speech.tts.TextToSpeech;
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.Locale;
  
  
  public class MainSpeechActivity extends Activity {
  
      TextToSpeech tts;
      Button btn;
      private String uri;
      private Uri uri2;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_speech);
  
  
          final Intent intent = getIntent();
          final String action = intent.getAction();
  
          if(Intent.ACTION_VIEW.equals(action)){
              //uri = intent.getStringExtra("URI");
              uri2 = intent.getData();
              uri = uri2.getEncodedPath() + "  complete: " + uri2.toString();
              TextView textView = (TextView)findViewById(R.id.textView);
              TextView textView2 = (TextView)findViewById(R.id.textView2);
              textView.setText(uri);
              // now you call whatever function your app uses
  
              String str = uri2.toString();// value is mentioned above
              File f = new File(str);
              BufferedReader br = null;
              String line;
              StringBuilder sbr = new StringBuilder();
  
              try {
                  br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
                  while((line = br.readLine()) != null) {
                      sbr.append(line);
                      sbr.append("\n");
  
                  }
                  br.close();
              } catch (FileNotFoundException e) {
                  Toast.makeText(getApplicationContext(),"FileNotFound",Toast.LENGTH_SHORT).show();
                  e.printStackTrace();
              } catch (IOException e) {
                  Toast.makeText(getApplicationContext(),"InputError",Toast.LENGTH_SHORT).show();
                  e.printStackTrace();
              }
              if(sbr.toString().isEmpty())
                  textView2.setText("Blah blah");
              else
              textView2.setText(sbr.toString());
  
  
  
  
          } else {
              Log.d("know", "intent was something else: " + action);
          }
  
          tts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
              @Override
              public void onInit(int i) {
                  if( i != TextToSpeech.ERROR) {
                      tts.setLanguage(Locale.ENGLISH);
                  }
              }
          });
  
          btn = (Button)findViewById(R.id.button1);
  
          btn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  String toSpeak = "My friend is very good programmer do you aggree";
  
                  Toast.makeText(getApplicationContext(),toSpeak,Toast.LENGTH_SHORT).show();
  
                  tts.speak(toSpeak,TextToSpeech.QUEUE_FLUSH,null);
              }
          });
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main_speech, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p><strong>If reading file from android is not possible then how to copy that file to sdcard or at location where reading and writing is possible</strong></p>