How come the last line of this code is not picking up the string filename in the code?
if (ressound == R.id.sound1) {
String filename = "sound1" + ".ogg";
} else {
String filename = "sound1" + ".ogg";
}
boolean exists = (new File(path)).exists();
if (!exists) { new File(path).mkdirs(); }
FileOutputStream save;
try {
save = new FileOutputStream(path + filename);
StringBuilderinternally which would not be required if you'd put it as one string like thisString filename = "sound1.ogg".