Tôi đã làm theo hướng dẫn trực tuyến về mã này. và sẽ xuất bản google play với android api 23 Marshmallow.android programming NameValuePair bị xóa cho api 23
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) {
String name = item.getName();
int i = 0;
while (results.containsKey(name)) {
name = item.getName() + ++i;
}
results.put(name, item.getValue());
}
} catch (URISyntaxException e) {
Log.w(TAG, "Invalid syntax error while decoding extras data from server.");
}
return results;
}
Nhưng NameValuePair và URLEncodedUtils đã bị xóa trong api23 Marshmallow. Làm thế nào tôi có thể thay đổi mã này?
Hãy giúp tôi.
có thể trùng lặp của [Cách sử dụng ứng dụng khách HTTP Apache cũ trên Android M?] (Http://stackoverflow.com/questions/31653002/how-to-use-the-legacy-apache-http- client-on-android-m) –