title: Read text file after chossing by Intent.ACTION_GET_CONTENT
body: <p>I'm trying to select text file by open file explorer then read the selected file.
  I tried many many solutions. the last one is this code </p>
  
  <pre><code>public void btnRead_Click(View view) {
      Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT);
      chooseFile.setType("text/plain");
      startActivityForResult(chooseFile, 1);
  }
  
  @Override
  protected void onActivityResult(int requestedCode, int resultCode, Intent data) {
  
      if (requestedCode == 1) {
          if (resultCode == RESULT_OK) {
  
              File file = new File(data.getDataString());
  
              StringBuilder text = new StringBuilder();
  
              try {
                  BufferedReader br = new BufferedReader(new FileReader(file));
                  String line;
  
                  while ((line = br.readLine()) != null) {
                      text.append(line);
                      text.append('\n');
                  }
                  br.close();
              }
              catch (IOException e){}
  
              textView = (TextView) findViewById(R.id.textView);
              textView.setText(text);
  
          }
  
      }
  }
  </code></pre>
  
  <p>Thanks in advance</p>