user1949387 user1949387 - 1 year ago 66
Java Question

NameValuePair deprecated for openConnection

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<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("username", username));
params.add(new BasicNameValuePair("password", password));

NameValuePair and BasicNameValuePair have been deprecated in favor of
. How can I create a new-value association with that?

Does anyone know how I can create name value pairs with openConnection? I been searching everywhere.

Answer Source

You can use contentValues for example

ContentValues values=new ContentValues();