在Android文件写的权限 [英] write in file permission in android

查看:122
本文介绍了在Android文件写的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用下列中的文件写:

i want to write in a file by using the following:

                BufferedWriter buf = new BufferedWriter(new FileWriter("test2"));
                        buf.write(mytext);
                        buf.close();

但我得到这个消息
(文件test2的只读)

but i got this message (file test2 read only)

我怎样才能写权限

推荐答案

你有没有在你的Andr​​oidManifest.xml文件中得到这个?

Have you got this in your AndroidManifest.xml file?

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

此外,这个环节有你需要了解读取和写入的文件的所有内容:

Also, this link has everything you need to know about reading and writing files:

<一个href=\"http://www.anddev.org/working_with_files-t115.html\">http://www.anddev.org/working_with_files-t115.html

这篇关于在Android文件写的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆