user1949387 user1949387 - 2 years ago 93
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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download