的NameValuePair是pcated在API 22日$ P $

编程入门 行业动态 更新时间:2024-10-25 10:29:59
本文介绍了的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 $

本文发布于:2023-10-24 08:52:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523491.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:pcated   NameValuePair   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!