Hy!!
I have a login form in my app, but i want to save/restore the textfile internal in the app not on the internal phone memory.
Are there some code snippets?
I made a internal file saving/restoring but it don't work.
if (cb.isChecked())
{
File file = new File("/mmt/sdcard/login.skip");
Writer output = null;
try
{
output = new BufferedWriter(new FileWriter(file));
output.write(etuser.getText().toString()+ ";" + etpw.getText().toString());
output.close();
}
catch (Exception e) {
// TODO: handle exception
}
}
File file = new File("/mmt/sdcard/login.skip");
if(file.exists())
{ try
{
BufferedReader input = new BufferedReader(new FileReader(file));
while (( line = input.readLine()) != null){
line2 = line;
}
etuser.setText(line2.split(";")[0]);
etpw.setText(line2.split(";")[1]);
input.close();
}
catch (Exception e) {
// TODO: handle exception
}
}