Possible Duplicate:
error opening trace file: No such file or directory (2)
i know this question is maybe answered before, but reading them i dont know how to resolve my problem.
This is my problem, i have this error message in the beginning of aplication, but despite this it works without problem, but error exits.
The error appear when i use files, but i dont use SD memory (so i think i dont need to modify manifest).
Someone know how to solve and help me? or maybe it's not important?
THANK YOU!!
This is the java code:
public class MainActivity extends Activity {
private Resultados Datos;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.Datos = new Resultados();
String[] archivos = fileList();
Log.v("myActivity"," "+archivos.length);
// Si no hay creado ningun archivo, creamos el primero todo a 0
if(archivos.length == 0) {
try {
OutputStreamWriter fout = new OutputStreamWriter(openFileOutput("Resultados", Context.MODE_PRIVATE));
Log.v("myActivity", "AHORA ESCRIBO");
fout.write(Datos.getSesentas()+"\n");
fout.write(Datos.getSetentas()+"\n");
fout.write(Datos.getOchentas()+"\n");
fout.write(Datos.getNoventas()+"\n");
fout.write(Datos.getDosmiles());
fout.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// Si existe el fichero, lo cargamos en un nuevo objeto resultados
else {
try {
BufferedReader carga = new BufferedReader(new InputStreamReader(openFileInput("Resultados")));
Log.v("myActivity", "AHORA LEO");
this.Datos.setSesentas(carga.readLine());
this.Datos.setSetentas(carga.readLine());
this.Datos.setOchentas(carga.readLine());
this.Datos.setNoventas(carga.readLine());
this.Datos.setDosmiles(carga.readLine());
carga.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Log.v("myActivity", this.Datos.getDosmiles());
}
public void StartPlay (View v) {
Intent Inicio = new Intent(MainActivity.this, Tabla.class);
//Creo el bundle para pasar la informacion a la siguiente actividad
Bundle Informacion = new Bundle();
Informacion.putString("60", this.Datos.getSesentas());
Informacion.putString("70", this.Datos.getSetentas());
Informacion.putString("80", this.Datos.getOchentas());
Informacion.putString("90", this.Datos.getNoventas());
Informacion.putString("00", this.Datos.getDosmiles());
Inicio.putExtras(Informacion);
startActivity(Inicio);
}
public void ShowHelp (View v) {
Intent Ayuda = new Intent(MainActivity.this, Help.class);
startActivity(Ayuda);
}
}