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;
android入门教程之Content Providerandroid入门教程之Content Provider隐藏>> 本文由麦可网 http://www.microoh.com/course 收集整理,转载请注明出处。 Android 基本...
android基础教程Content Provider_互联网_IT/计算机_专业资料。android基础教程Content ProviderAndroid基本之Content Provider 如果你要公开你的数据,你可以创建或者使用...
Content provider android 基础_IT/计算机_专业资料。android content provider example本文参考: http://androidappdocs.appspot.com/guide/topics/providers/content...
Android content provider基础与使用 android有一个独特之处就是,数据库只能被它的创建者所使用,其他的应用是不能访问到的,所以如果你想实现不同应用之间的数据...
android content Provider 用法和理解_计算机软件及应用_IT/计算机_专业资料。... 中医护理学基础重点 执业医师实践技能考试模拟试题 20份文档 乘机安全小贴士 ...
android Content Provider的使用_计算机软件及应用_IT/计算机_专业资料。android ... 2014年证劵市场基础知识冲刺试题 2014年统计法基础知识精讲 68份文档 新市场...
Android平台中实现数据共享的机制Content Provider_计算机软件及应用_IT/计算机_... Android如何通过content... 6页 免费 android基础教程Content... 暂无评价 1...
Android四大组件之ContentProvider 一、什么是ContentProvider 什么是 ContentProvider用来存储和检索数据 ContentProvider是应用之间互相访问数据的唯一 方法 Android自身提供...
40页 免费 Android应用开发入门教程... 130页 1下载券Andr...Android 使用ContentProvider共享数据 当应用继承ContentProvider类,并重写该类用于...
android入门 隐藏>> Android 介绍 1. 2. 3. 4. 5. 6. Android 开发...content provider正 是用来解决不同应用包之间共享数据的 Android应用解析 (4) ...
热门文档