关于SystemProperies的注意事项
2013-09-18 15:06
211 查看
在使用SystemProperties时出现了开机后不断重启的问题,看log 筛选system android 找到
E/AndroidRuntime(14952): at android.os.SystemProperties.get(SystemProperties.java:64)
然后查看Framework源码SystemProperties.java:64,定位到如下位置:
/**
* Get the value for the given key.
* @return if the key isn't found, return def if it isn't null, or an empty string otherwise
* @throws IllegalArgumentException if the key exceeds 32 characters
*/
public static String get(String key, String def) {
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get(key, def);
}
原来SystemProperties的key长度不能超过30字节。自此问题解决
E/AndroidRuntime(14952): at android.os.SystemProperties.get(SystemProperties.java:64)
然后查看Framework源码SystemProperties.java:64,定位到如下位置:
/**
* Get the value for the given key.
* @return if the key isn't found, return def if it isn't null, or an empty string otherwise
* @throws IllegalArgumentException if the key exceeds 32 characters
*/
public static String get(String key, String def) {
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get(key, def);
}
原来SystemProperties的key长度不能超过30字节。自此问题解决
相关文章推荐
- 关于使用READ TABLE语句的几点注意事项
- HTML5语音播报引发的:关于TTS引擎扩展及修复注意事项
- 关于线程堆栈大小的注意事项
- 关于Java字符串数组的额外注意事项
- 关于AE中IFeatureWorkspace.CreateFeatureClass Example 的诸参数注意事项解释
- 关于Android模拟键盘使用的注意事项
- 关于while里面条件变量的注意事项
- 关于常见的变量修饰符: const, static, extern, register, auto 的详细解释,使用场合以及注意事项
- 关于会议论文会后投期刊,及论文版权的一些注意事项。
- 关于异步读写串口的注意事项
- 关于写代码的注意事项之,全部英文注释,tab缩进换成四个空格的缩进,代码末尾不能有空格
- 关于WCF开发 相应流程注意事项
- 关于《精通css》之几个不错的注意事项
- 关于用GSM MODEM模块实现打电话发短信注意事项
- 关于现代都市入宅搬家注意事项
- 关于wince6.0 升级全年包的注意事项(作者:gooogleman)
- 关于oracle inner join ,out join 的一点注意事项
- 关于#ifdef的一个注意事项
- 关于Jquery中的链式编程和动画效果(注意事项)
- 关于重载的概念和使用时的注意事项