2

重複の可能性:
トレース ファイルを開く際のエラー: そのようなファイルまたはディレクトリはありません (2)

この質問はおそらく以前に回答されていることを知っていますが、それらを読んでも問題を解決する方法がわかりません。

これは私の問題です。アプリケーションの最初にこのエラー メッセージが表示されますが、問題なく動作しますが、エラーが発生します。

ファイルを使用するとエラーが表示されますが、SD メモリは使用していません (マニフェストを変更する必要はないと思います)。

誰かが私を解決して助ける方法を知っていますか? または多分それは重要ではありませんか?

ありがとうございました!!

これはJavaコードです:

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);
}

}

4

0 に答える 0