NameValuePair deprecated for openConnection

前端 未结 7 1216
梦谈多话
梦谈多话 2020-12-01 06:09

I been following online tutorials on how to insert data into a database from an android app and have everything working except this small part

List

        
7条回答
  •  无人及你
    2020-12-01 06:41

    I just ran into the same problem. The deprecated classes from org.apache.http have been removed in API 23.

    I ended up using android.util.Pair. It works perfectly, and the code is shorter too:

    List> params = new ArrayList<>();
    params.add(new Pair<>("username", username));
    params.add(new Pair<>("password", password));
    

提交回复
热议问题