Man erkennt ja nichts auf dem Bild also schicke ich euch den Code so:
public void getname(View v)throws IOException{
// Eingabe von Namen und auswahl des Wochenrhythmus des Stundenplans
Button weiter = (Button)findViewById(R.id.btn_weiter);
weiter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String name;
boolean anzahl1;
boolean anzahl2;
int selectID;
EditText eingabe = (EditText)findViewById(R.id.ed_eingabe);
TextView ausgabe = (TextView)findViewById(R.id.tv_ausgabe);
RadioGroup woche = (RadioGroup)findViewById(R.id.radioWoche);
selectID = woche.getCheckedRadioButtonId();
FileWriter fw;
RadioButton auswahl = (RadioButton)findViewById(selectID);
anzahl1 = false;
anzahl2 = false;
if(selectID == R.id.radio1){
anzahl1 = true;
}
else if(selectID == R.id.radio2){
anzahl2 = true;
}
name = eingabe.getText().toString();
try{
String path = Environment.getExternalStorageDirectory().getPath() + "/Test/"+name+".txt";
File f = new File(path);
if(!f.exists()){
f.getParentFile().mkdirs();
f.createNewFile();
}// ende if
BufferedWriter write = new BufferedWriter(new FileWriter(f));
write.write("test");
write.close();
ausgabe.setText("Klappt");
}// ende try
catch (IOException e){
e.printStackTrace();
ausgabe.setText("Klappt nicht");
}// ende catch
}// ende onClick
});// Ende get name
}