Android的错误:路径请求必须通过使用UserEnvironment其中指定用户 [英] Android error: Path requests must specify a user by using UserEnvironment
本文介绍了Android的错误:路径请求必须通过使用UserEnvironment其中指定用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行Android系统服务code:我收到以下错误:
When I am running the code in Android system service: I get the following error:
15 12-10:27:43.762:A /环境(674):路径请求必须通过使用UserEnvironment其中指定用户
12-10 15:27:43.762: A/Environment(674): Path requests must specify a user by using UserEnvironment
在code,让错误是:
The code that gives error is:
if (ext.equals(Environment.MEDIA_MOUNTED)) {
loc = Environment.getExternalStorageDirectory().getAbsolutePath(); // this line gives error
}
为什么它表明这个错误?
谢谢你。
Why does it show this error ? Thanks.
推荐答案
我用:
Environment.setUserRequired(false);
摆脱错误的。
这篇关于Android的错误:路径请求必须通过使用UserEnvironment其中指定用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文