Impossible de créer un fichier sur mon samsung galaxy S
Tout est dans le titre, je n'arrive pas a créer un fichier dans mon répertoire principal sur mon samsung galaxy S, voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
package gibSG.dev.compteApp;
import java.io.File;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;
public class CompteAppActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
// tv.setText("CompteApp");
File fichier = new File("/mnt/sdcard/compte.sav");
tv.setText("TRUE");
try {
if(!fichier.exists()){
tv.setText("FALSE");
fichier.createNewFile();
}
}
catch(Exception e) { e.printStackTrace(); }
setContentView(tv);
}
} |
Mon appli affiche FALSE .. et je ne trouve aucun fichier compte.sav dans mon répertoire..
Quelqu'un serait si le problème vient de mon code ou autre ?