I have have this app where in my main menu and I want to show the earned stars in a textview which is written in a text file. And also if I earned more stars I want to read the data and add the earned stars and append to the txtfile. For some reasons my app crashes and I have been stuck here for hours. Can anyone please help me with this?

Here's my code:

```js
import android.widget.TextView;

public class MainActivity extends Activity {

  private static TextView txt_stars;
  private static final String FILENAME = "Stars.txt";

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

    onButtonClickListener();
    txt_stars = (TextView) findViewById(R.id.txtStars);
    //This is where I should view the number of stars remaining
  }

  public void onButtonClickListener {

    button_next = (Button) findViewById(R.id.btnNext);
    button_next.setOnClickListener(
      new View.OnClickListener() {

      @Override
        public void onClick(View v) {
          AlertDialog.Builder alert = new AlertDialog.Builder(context);
          alert.setMessage("You have earned 50 stars");
          alert.setCancelable(false);
          alert.setPositiveButton("next", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {
              //Can anyone please help me here?
            //this should compute the data inserted in textfile and the stars earned, and the result should append to the file.
            }
          });
          AlertDialog alertDialog = alert.create();
          alertDialog.show();
        }
      }
    );

  }

}
```

Thanks for the help.