Ho seguito tutorial online su questo codice. e pubblicherà google play con Android api 23 Marshmallow.programmazione android NameValuePair rimosso per 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;
}
Ma NameValuePair e URLEncodedUtils sono stati cancellati nella api23 Marshmallow. Come posso cambiare questo codice?
Per favore aiutatemi.
possibile duplicato di [Come utilizzare l'eredità client HTTP Apache su Android M?] (Http://stackoverflow.com/questions/31653002/how-to-use-the-legacy-apache-http- client-on-android-m) –