本文介绍了的NameValuePair是pcated在API 22日$ P $的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在的NameValuePair是德precated的API 22.我能做些什么,如果我要实现的NameValuePair界面。 下面是我的code
包com.example.passpass; 进口org.apache.http.NameValuePair; 公共类DoubleNameValuePair实现的NameValuePair { 字符串名称; 双重价值; 公共DoubleNameValuePair(字符串名称,双击值){ this.name =名称; THIS.VALUE =价值; } @覆盖 公共字符串的getName(){ 返回名称; } @覆盖 公共字符串的getValue(){ 返回Double.toString(值); } }解决方案
您可以使用contentValues例如:
ContentValues值=新ContentValues(); values.put(用户名,名); values.put(密码,密码);Now that namevaluepair is deprecated in API 22. What can i do if i want to implement 'namevaluepair' interface. below is my code
package com.example.passpass; import org.apache.http.NameValuePair; public class DoubleNameValuePair implements NameValuePair{ String name; double value; public DoubleNameValuePair(String name, double value) { this.name = name; this.value = value; } @Override public String getName() { return name; } @Override public String getValue() { return Double.toString(value); } }解决方案
You can use contentValues for example
ContentValues values=new ContentValues(); values.put("username",name); values.put("password",password);
更多推荐
的NameValuePair是pcated在API 22日$ P $
发布评论