mail-archives/monodroid/2011-December/008010.html

125 строки
5.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] SimpleCursorAdapter &amp; Managed Query
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20SimpleCursorAdapter%20%26%20Managed%20Query&In-Reply-To=1324464866023-5091540.post%40n5.nabble.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="008008.html">
<LINK REL="Next" HREF="008009.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] SimpleCursorAdapter &amp; Managed Query</H1>
<B>Nathan Blevins</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20SimpleCursorAdapter%20%26%20Managed%20Query&In-Reply-To=1324464866023-5091540.post%40n5.nabble.com"
TITLE="[mono-android] SimpleCursorAdapter &amp; Managed Query">nblevins at nathanblevins.com
</A><BR>
<I>Wed Dec 21 09:03:45 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="008008.html">[mono-android] SimpleCursorAdapter &amp; Managed Query
</A></li>
<LI>Next message: <A HREF="008009.html">[mono-android] 4.0 RequestLocationUpdates crash
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#8010">[ date ]</a>
<a href="thread.html#8010">[ thread ]</a>
<a href="subject.html#8010">[ subject ]</a>
<a href="author.html#8010">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Enrico,
I appreciate the feedback there. Actually this runs pefectly on 2.2 - 3.*.
Its only when I deploy to 4.0 that I start to get the error. There is
something in the change to 4.0 that is causing the issue, though I am
unclear what that may be.
Nathan
On Wed, Dec 21, 2011 at 5:54 AM, caruso &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">djtails at gmx.net</A>&gt; wrote:
&gt;<i> Simple Cursor Adapter inherits the CursorAdapter where the docs the
</I>&gt;<i> following
</I>&gt;<i> sentences say:
</I>&gt;<i>
</I>&gt;<i> Class Overview
</I>&gt;<i> Adapter that exposes data from a Cursor to a ListView widget. The Cursor
</I>&gt;<i> must include a column named &quot;_id&quot; or this class will not work.
</I>&gt;<i>
</I>&gt;<i> <A HREF="http://developer.android.com/reference/android/widget/CursorAdapter.html">http://developer.android.com/reference/android/widget/CursorAdapter.html</A>
</I>&gt;<i>
</I>&gt;<i> so you can use:
</I>&gt;<i> String CREATED - The date the item created, in milliseconds since the
</I>&gt;<i> epoch.
</I>&gt;<i> String DATE - The date the item was last visited, in milliseconds since the
</I>&gt;<i> epoch.
</I>&gt;<i>
</I>&gt;<i> I haven't tested it but it is worth a try.
</I>&gt;<i>
</I>&gt;<i> Enrico
</I>&gt;<i>
</I>&gt;<i> Re: SimpleCursorAdapter &amp; Managed Query
</I>&gt;<i> Dec 21, 2011; 11:27am &#8212; by Dragos Pop
</I>&gt;<i> &gt; It seems that at &quot;Java&quot; level, the SimpleCursorAdapter needs a key field
</I>&gt;<i> &gt; called _id. See also
</I>&gt;<i> &gt;
</I>&gt;<i> <A HREF="http://stackoverflow.com/questions/5825020/android-column-id-does-not-exist-problem">http://stackoverflow.com/questions/5825020/android-column-id-does-not-exist-problem</A>
</I>&gt;<i>
</I>&gt;<i> --
</I>&gt;<i> View this message in context:
</I>&gt;<i> <A HREF="http://mono-for-android.1047100.n5.nabble.com/SimpleCursorAdapter-Managed-Query-tp5063665p5091540.html">http://mono-for-android.1047100.n5.nabble.com/SimpleCursorAdapter-Managed-Query-tp5063665p5091540.html</A>
</I>&gt;<i> Sent from the Mono for Android mailing list archive at Nabble.com.
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Monodroid mailing list
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
</I>&gt;<i>
</I>&gt;<i> UNSUBSCRIBE INFORMATION:
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
</I>&gt;<i>
</I>-------------- next part --------------
An HTML attachment was scrubbed...
URL: <A HREF="http://lists.ximian.com/pipermail/monodroid/attachments/20111221/d0cd5df4/attachment.html">http://lists.ximian.com/pipermail/monodroid/attachments/20111221/d0cd5df4/attachment.html</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="008008.html">[mono-android] SimpleCursorAdapter &amp; Managed Query
</A></li>
<LI>Next message: <A HREF="008009.html">[mono-android] 4.0 RequestLocationUpdates crash
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#8010">[ date ]</a>
<a href="thread.html#8010">[ thread ]</a>
<a href="subject.html#8010">[ subject ]</a>
<a href="author.html#8010">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
mailing list</a><br>
</body></html>