java - Android - Error in writing to file -


I have a code I want to do that is not working.

  deleteFile (mealFile); // TODO: Try {FileOutputStream fos = openFileOutput (foodfile, MODE_APPEND); OutputStream Water OSV = New OutputStream Water (Force); For (int i = 0; i & lt; temp_name.size (); i ++) {if (! (Temp_name.get (i) .equals (mealName.getText). ToString ()) {osw. Append (temp_name) (i) + "\ t"); Osw.append (temp_meals.get (i) + "\ t"); Osw.append (temp_scale.get (i) + "\ t"); System.getProperty ("line.separator"); }}} Hold (exception e) {updateWarningMessage (6); }   

Something should be clear that I am missing out. This code does not want to add anything to the file. I know that the code is not unsuccessful (no exceptions), I know that the array is trying to include the list I am not empty and contains the strings (I also "osw.append" ("test") I have also tried; "with no luck) I know that the four-loop is going on as many times as it is supposed to, and as I said to some extent, I know that" if "is working First of all, though, this file was delayed or delayed in something else, But after trying DeleteFile () I tried to add a method writing text directly into this file, and this part worked .. And still, this code does not add anything.

Does anyone have a clue that can be wrong ?? Im completely lost, the other method looks to add somewhat to the extent of adding Im. Try now to try ArrayLists to pass a new method and connect it from there, but I do not like leaving such weird behaivour unsolved. I hope that this is not clear from coding all days. Can anyone find any place?

After each recurrence I flush () closed () Stream at the end, because it is a normal process while working with the file.

  try {FileOutputStream fos = openFileOutput (mealFile, MODE_APPEND); OutputStream Water OSV = New OutputStream Water (Force); For (int i = 0; i & lt; temp_name.size (); i ++) {if (! (Temp_name.get (i) .equals (mealName.getText). ToString ()) {osw. Append (temp_name) (i) + "\ t"); Osw.append (temp_meals.get (i) + "\ t"); Osw.append (temp_scale.get (i) + "\ t"); System.getProperty ("line.separator"); osw.flush (); }} Osw.close (); } Hold (exception e) {updateWarningMessage (6); }    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -