ContentValues怎么用的?

一般使用ContentValues


ContentValues contentValues = new ContentValues();
<p class="p1">contentValues.put(key, value);</p><p class="p1">context.getContentResolver().insert(url, contentValues);//其中url是Uri类型的</p>




挺好奇的,就看了一下ContentValues源码,本来想着应该是个键值对神马的,hashmap之类的,结果。。


源码中的ContentValues看着挺奇怪的


package android.content;
public final class ContentValues
  implements android.os.Parcelable
{
public  ContentValues() { throw new RuntimeException("Stub!"); }
public  ContentValues(int size) { throw new RuntimeException("Stub!"); }
public  ContentValues(android.content.ContentValues from) { throw new RuntimeException("Stub!"); }
public  boolean equals(java.lang.Object object) { throw new RuntimeException("Stub!"); }
public  int hashCode() { throw new RuntimeException("Stub!"); }
<span style="color:#ff0000;">public  void put(java.lang.String key, java.lang.String value) { throw new RuntimeException("Stub!"); }
</span>public  void putAll(android.content.ContentValues other) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Byte value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Short value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Integer value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Long value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Float value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Double value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, java.lang.Boolean value) { throw new RuntimeException("Stub!"); }
public  void put(java.lang.String key, byte[] value) { throw new RuntimeException("Stub!"); }
public  void putNull(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  int size() { throw new RuntimeException("Stub!"); }
public  void remove(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  void clear() { throw new RuntimeException("Stub!"); }
public  boolean containsKey(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Object get(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.String getAsString(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Long getAsLong(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Integer getAsInteger(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Short getAsShort(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Byte getAsByte(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Double getAsDouble(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Float getAsFloat(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.lang.Boolean getAsBoolean(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  byte[] getAsByteArray(java.lang.String key) { throw new RuntimeException("Stub!"); }
public  java.util.Set<java.util.Map.Entry<java.lang.String, java.lang.Object>> valueSet() { throw new RuntimeException("Stub!"); }
public  java.util.Set<java.lang.String> keySet() { throw new RuntimeException("Stub!"); }
public  int describeContents() { throw new RuntimeException("Stub!"); }
@java.lang.SuppressWarnings(value={"deprecation"})
public  void writeToParcel(android.os.Parcel parcel, int flags) { throw new RuntimeException("Stub!"); }
public  java.lang.String toString() { throw new RuntimeException("Stub!"); }
public static final java.lang.String TAG = "ContentValues";
public static final android.os.Parcelable.Creator<android.content.ContentValues> CREATOR;
static { CREATOR = null; }
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值