问题描述
我想在Android 2.2的设置系统属性。采用Android Eclipse的插件。这是造成异常的行是:
I'm trying to set a system property in Android 2.2. Using Android for eclipse plug-in. The line that's causing the exception is:
Settings.Secure.putString(getContentResolver(),
Settings.Secure.HTTP_PROXY, "127.0.0.1:8099")
和而我越来越模拟器中运行:
And while running in the emulator I'm getting:
22 08-01:48:44.338:ERROR / DatabaseUtils(58):java.lang.SecurityException异常:权限拒绝:写保护设置需要android.permission.WRITE_SECURE_SETTINGS
我已经在我的AndroidManifest.xml中的应用程序标签的前面以下行:
I have already in my AndroidManifest.xml the following lines in front of the 'application' tag:
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
还有什么我缺少什么?
What else am I missing?
推荐答案
非系统应用程序不能使用 WRITE_SECURE_SETTINGS
的权限。
Non-system applications aren't allowed to use the WRITE_SECURE_SETTINGS
permission.
这篇关于Android的java.lang.SecurityException异常的Settings.Secure.putString()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!