android - Problems with Serialization -
There are some problems with sorting my items.
Missing, because my app is not like saving .dat.
We show some code:
load .dat file Save the .dat file When I try to save the file, my app catches the exception FileNotFoundException here: Fitch is: What am I missing? For better help, I give my code here. Thanks in advance! You pass the whole path instead of the file name on the file only If doing so does not try it
Public Zero Dark (Object Output Stream Out) IOException Throws {out.writeObject (lista); Out.writeObject (cadeiras); Out.writeObject (notas); Out.close (); }
throws the Public Zero Effective (ObjectInputStream in) IOException, ClassNotFoundException {lista = (ArrayList & Lt; string & gt;) in.readObject (); Cadeiras = (ArrayList & lt; string & gt;) in.readObject (); Notas = (ArrayList & lt; string & gt;) in.readObject (); In.close (); }
case R.id. Gravar: Object OutputStream Out; Try {out = new object overputstream (new file output stream (FICH)); Gravar (outside); Toast. Make Text (getApplicationContext (), "Good!", Toast. LNNGH_LAG). Show (); } Hold (FileNotFoundException E) {// TODO Auto-Generated Catch Block Toast MakeApplicationContext (), "Error 1!", Toast. LNNGGH_LOG). Show (); E.printStackTrace (); } Grip (IOE EXPRESS E) {Toast. MakeApplicationContext (), "Error 2!", Toast.LnnGH_LOG). Show (); E.printStackTrace (); } Back true;
Private Static String Fitch = "gravar.dat";
New FileOutputStream (new file (Fitch));
Comments
Post a Comment