[英]Can I create password protected folder in Android?
I would like to create a folder which is password protected. 我想创建一个受密码保护的文件夹。 I am able to create a folder in the following way, but how can I create a password protected folder?
我可以通过以下方式创建文件夹,但是如何创建受密码保护的文件夹?
File nf = new File("/sdcard/NewFolder");
nf.mkdirs();
Note: it is visible on windows pc 注意:在Windows PC上可见
You can't create such a folder on sdcard. 您无法在sdcard上创建这样的文件夹。 Everything that's saved onto sdcard can be accessed by other applications.
保存到sdcard上的所有内容都可以被其他应用程序访问。 If you want to create a folder which is not accessible from outside of your application use Context.getDir() method with mode set to MODE_PRIVATE :
如果要创建无法从应用程序外部访问的文件夹,请使用Context.getDir()方法(其模式设置为MODE_PRIVATE) :
Context ctx = getContext();
File folder = ctx.getDir("NewFolder", Context.MODE_PRIVATE);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.