I am doing a project to read a `txt` file from sdcard and copy its content to next activity. When I select the `txt` file app goes blank. It's going to display blank.

Here's MainActivty.java

```
package com.texttospeech.tts;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import static java.util.logging.Logger.global;

public class MainActivity extends AppCompatActivity {
static final int READ_REQ = 24;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Button ibutton = (Button) findViewById(R.id.ibutton);
    ibutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
           performFileSearch();
        }
    });
}

private void performFileSearch() {
    Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    intent.addCategory(Intent.CATEGORY_OPENABLE);
    intent.setType("text/*");
    startActivityForResult(intent, READ_REQ);
}

public void onActivityResult(int requestCode, int resultCode, Intent resultData){
    if(resultCode == Activity.RESULT_OK){
        Uri uri = null;
        if (resultData !=null){
            uri = resultData.getData();
        }
        if (requestCode == READ_REQ){
            readTextFile(uri);
        }
    }
}
private String readTextFile(Uri uri){
    InputStream inputStream = null;
    try {
        inputStream = getContentResolver().openInputStream(uri);
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
        //StringBuilder builder = new StringBuilder();
        String line;
        Log.i("","open text file - content"+"\n");
        while ((line = reader.readLine())!=null){
           // builder.append((String)line);
            Log.i("",line+"\n");
        }
        reader.close();
        inputStream.close();

        String txt = readTextFile(uri);
        Intent i = new Intent(MainActivity.this, Main2Activity.class);
        i.putExtra("txt",txt);
        startActivity(i);

    }catch (Exception e){
        e.printStackTrace();
    }

    return null;
}
}

```

Here's my Main2Activity.java

```
package com.texttospeech.tts;

import android.content.Intent;
import android.speech.tts.TextToSpeech;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;

import java.util.Locale;

public class Main2Activity extends AppCompatActivity implements TextToSpeech.OnInitListener {
private Button play,stop;
private EditText editText;
private TextToSpeech engine;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);
    String res = getIntent().getStringExtra("txt");
    play = (Button) findViewById(R.id.play);
    stop =  (Button) findViewById(R.id.stop);
    editText = (EditText) findViewById(R.id.editText);
    editText.setText(res);
}

public void speak(){
    String tospeak = editText.getText().toString();
    engine.speak(tospeak, TextToSpeech.QUEUE_FLUSH,null,null);
}

public void stop(){
    if(engine!=null){
        engine.stop();
    }
}

 @Override
protected void onDestroy() {
    super.onDestroy();
    if(engine!=null){
        engine.stop();
        engine.shutdown();
    }
}

@Override
public void onInit(int status) {
    if (status == TextToSpeech.SUCCESS) {
        engine.setLanguage(Locale.UK);
    }
}
}

```

Main2Activity goes blank after selecting txt file . I dont know how to get the content to a string variable .