Firstly, you are missing a setOnClickListener for your button. It should be...
b = (Button) findViewById(R.id.button1); b.setOnClickListener(this);
"but I canβt find the saved file, I canβt even find the directory in which the file should be saved."
getApplicationContext().getFilesDir() will tell you where the file was saved.
Android docs say ...
The internal application storage directory is indicated by your application package name in a special place on the Android file system.
To save the array to a file, try the following ...
String filename = "myfile"; String[] numbers = new String[] {"1, 2, 3"}; FileOutputStream outputStream; try { outputStream = openFileOutput(filename, Context.MODE_APPEND); for (String s : numbers) { outputStream.write(s.getBytes()); } outputStream.close(); } catch (Exception e) { e.printStackTrace(); }
source share