Lvl库在Android Marshmallow上不再编译,因为缺少已删除的Apache相关内容。您可以添加useLibrary 'org.apache.http.legacy'
,但这只是一个临时解决方法。问题出在这个方法上:
private Map<String, String> decodeExtras(String extras) {
Map<String, String> results = new HashMap<String, String>();
try {
URI rawExtras = new URI("?" + extras);
List<NameValuePair> extraList = URLEncodedUtils.parse(rawExtras, "UTF-8");
for (NameValuePair item : extraList) {
results.put(item.getName(), item.getValue());
}
} catch (URISyntaxException ignored) {
}
return results;
}
NameValuePair
和URLEncodedUtils
未找到。
新的"方式"
是什么?我该如何用符合新的Android版本的新代码替换此调用?