文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > Android中content provider的使用入门
侵权投诉

Android中content provider的使用入门

Android中content provider的使用入门

switch (URI_MATCHER.match(uri)) {

case ALL_MESSAGES:

return "vnd.android.cursor.dir/rssitem"; // List of items. case SPECIFIC_MESSAGE:

return "vnd.android.cursor.item/rssitem"; // Specific item. default:

return null;

}

}

/*

* (non-Javadoc)

*

* @see android.content.ContentProvider#insert(android.net.Uri, * android.content.ContentValues)

*/

@Override

public Uri insert(Uri uri, ContentValues values) {

// NOTE Argument checking code omitted. Check your parameters! Check that

// your row addition request succeeded!

long rowId = -1;

rowId = mDb.insert(DATABASE_TABLE_NAME, NAME, values); Uri newUri = Uri.withAppendedPath(CONTENT_URI, ""+rowId);

Log.i("TestContentProvider", "saved a record " + rowId + " " + newUri); // Notify any listeners and return the URI of the new row.

getContext().getContentResolver().notifyChange(CONTENT_URI, null);

return newUri;

上一页第5页

你可能喜欢

热门文档

相关文档

  • android入门教程之Content Provider

    android入门教程之Content Providerandroid入门教程之Content Provider隐藏>> 本文由麦可网 http://www.microoh.com/course 收集整理,转载请注明出处。 Android 基本...

  • android基础教程Content Provider

    android基础教程Content Provider_互联网_IT/计算机_专业资料。android基础教程Content ProviderAndroid基本之Content Provider 如果你要公开你的数据,你可以创建或者使用...

  • Content provider android 基础

    Content provider android 基础_IT/计算机_专业资料。android content provider example本文参考: http://androidappdocs.appspot.com/guide/topics/providers/content...

  • Android content provider基础与使用

    Android content provider基础与使用 android有一个独特之处就是,数据库只能被它的创建者所使用,其他的应用是不能访问到的,所以如果你想实现不同应用之间的数据...

  • android content Provider 用法和理解

    android content Provider 用法和理解_计算机软件及应用_IT/计算机_专业资料。... 中医护理学基础重点 执业医师实践技能考试模拟试题 20份文档 乘机安全小贴士 ...

  • android Content Provider的使用

    android Content Provider的使用_计算机软件及应用_IT/计算机_专业资料。android ... 2014年证劵市场基础知识冲刺试题 2014年统计法基础知识精讲 68份文档 新市场...

  • Android平台中实现数据共享的机制Content Provider

    Android平台中实现数据共享的机制Content Provider_计算机软件及应用_IT/计算机_... Android如何通过content... 6页 免费 android基础教程Content... 暂无评价 1...

  • Android基础-ContentProvider

    Android四大组件之ContentProvider 一、什么是ContentProvider 什么是 ContentProvider用来存储和检索数据 ContentProvider是应用之间互相访问数据的唯一 方法 Android自身提供...

  • Android 使用ContentProvider共享数据

    40页 免费 Android应用开发入门教程... 130页 1下载券Andr...Android 使用ContentProvider共享数据 当应用继承ContentProvider类,并重写该类用于...

  • android入门

    android入门 隐藏>> Android 介绍 1. 2. 3. 4. 5. 6. Android 开发...content provider正 是用来解决不同应用包之间共享数据的 Android应用解析 (4) ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email