如何处理Android编程中不推荐使用的方法? [英] How do I Deal with deprecated methods in Android Programming?

查看:138
本文介绍了如何处理Android编程中不推荐使用的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android Studio中使用一些旧代码参考进行编码。

我面临一些不推荐使用的方法。

哪里可以找到替换已弃用的方法的参考?



这是我使用的代码

1. DefaultHttpClient httpClient = new DefaultHttpClient();

HttpPost httpPost = new HttpPost(url);

httpPost.setEntity(new urlEncodedFormEntity(params));

HttpResponse httpResponse = httpClient.execute(httpPost);

HttpEntity httpEntity = httpResponse.getEntity();





2. params.add(new BasicNameValuePair(tag,login_tag));

params.add(new BasicNameValuePair(email,email));

params.add(new BasicNameValuePair(password,password));

解决方案

检查出来:https://www.youtube.com/watch?v=aRVTVrn9ozM [ ^ ]

I am using some old code reference for coding in Android Studio.
I am facing some methods which are deprecated.
Where I can find reference to replace the deprecated methods?

This is the code I am using
1. DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();


2. params.add(new BasicNameValuePair("tag", login_tag));
params.add(new BasicNameValuePair("email", email));
params.add(new BasicNameValuePair("password", password));

解决方案

Check this out: https://www.youtube.com/watch?v=aRVTVrn9ozM[^]


这篇关于如何处理Android编程中不推荐使用的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆