My code snippets:
1. String filePath = "file:///assets/android.txt";
2. OutputStream os= openFileOutput(filePath,
MODE_WORLD_WRITEABLE);
3. OutputStreamWriter osw = new OutputStreamWriter(os);
4. outWriter.write("hello...");
5. outWriter.flush();
6. outWriter.close();
The object "os" is null on line 2. Here is my question : I cannot get
the outputstream.
If the filePath = "android.txt", then it will be writen upder "data/
data/com.file/files/".
I need get the outputstream from folder "assets" . Can you help me?
Thx,
Amon
On 9月13日, 下午1时22分, Zsolt Vasvari <[email protected]> wrote:
> Have you though of the assets being read only? Even the name suggests
> that it might be.
>
> On Sep 13, 12:29 pm, amon wu <[email protected]> wrote:
>
>
>
> > Hi,
>
> > My case 1: I am trying to write a file into folder 'Assets' for a
> > test, but I cannot do it.
>
> > My case 2: I write the into sdcard , then copy it to the folder, and I
> > still fail.
>
> > Can you give me some advice?
>
> > thx && base regards,
> > Amon- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en