I would like to be able to open the files in a ListView
of an activity
that contains my application. These files are being saved in another activity, and always with the same extension ( .prop
for making it unique).
What I do not know is how to get the list of these files in an array (since I have no idea where each file is stored .prop
).
I attached the code when I save each file:
final EditText input = new EditText(Insercion.this);
new AlertDialog.Builder(Insercion.this)
.setTitle("Nombre del fichero")
.setView(input)
.setPositiveButton("Guardar", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String editable = input.getText().toString();
// aquí guardo lo aceptado
try {
FileOutputStream fos = openFileOutput(editable+".prop", Context.MODE_WORLD_READABLE);
ObjectOutputStream salida=new ObjectOutputStream(fos);
salida.writeObject(carteles);
fos.close();
salida.close();
}catch (Exception e){
e.printStackTrace();
System.out.println("ERROR ESCRITURA");
}
}
})
.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
}).show();