i had a problem about save file
Using java Syntax Highlighting
- FileOutputStream fOut;
- final String TESTSTRING = new String("Hello Android");
- try {
- fOut = context.openFileOutput("success.txt", context.MODE_WORLD_READABLE);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- OutputStreamWriter osw = new OutputStreamWriter(fOut);
- try {
- osw.write(TESTSTRING);
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- //mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
- /* ensure that everything is
- * really written out and close */
- try {
- fOut.flush();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- try {
- fOut.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
the FileOutputStream of fOut is null, when openFileOutput().



