Android(安卓)Uri.getQueryParameter使用注意
16lz
2021-01-26
/** * Searches the query string for the first value with the given key. * * Warning: Prior to Jelly Bean, this decoded * the '+' character as '+' rather than ' '. * * @param key which will be encoded * @throws UnsupportedOperationException if this isn't a hierarchical URI * @throws NullPointerException if key is null * @return the decoded value or null if no parameter is found */ public String getQueryParameter(String key)
在Android中操作Uri经常会调用上述方法,可能自己粗心大意,没注意注释,注释上已经说明,返回值是null或者是解码之后的内容。所以通常不需要自己在对返回值进行解码,否则可能引起二次解码带来的问题。
更多相关文章
- 调用getChildFragmentManager时出现的Bug
- Android(安卓)直接通过JNI访问驱动
- Android(安卓)SQLite数据库增删改查
- android支付宝 KeyFactory PrivateKey
- android之gradle构建工具学习之路(二)
- android个推消息推送,asp.net调用接口
- Android(安卓)API Level 与 Platform Version之间的关系
- DrawLayout几个注意点
- AES加解密源码(直接可调用)