2012年11月29日 星期四

Write file into Internal Storage


        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();
}

沒有留言:

張貼留言

Related Posts Plugin for WordPress, Blogger...