String fileName = "test";
        String content="123";
        FileOutputStream writer = null;
  try {
   writer = openFileOutput(fileName, Context.MODE_PRIVATE);
  } catch (FileNotFoundException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
        try {
   writer.write(content.getBytes());
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
        try {
   writer.close();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 
沒有留言:
張貼留言