On Tue, Jan 6, 2009 at 9:07 PM, Mark Murphy <mmur...@commonsware.com> wrote:

>
> Faber Fedor wrote:
> > So the class name goes into the manifest.  what is my CONTENT_URI then?
> > I'm assuming it's "content://com.appspot.lbtdl".  Since I have a table
> > called "locations", I'll access all of the locations with
> > "content://com.appspot.lbtdl/locations", right?
>
> You can. There's nothing forcing that pattern, though.
>
> What *is* magic is that there is a public static final Uri named
> CONTENT_URI, and that this Uri is the base Uri for your provider, and
> that it begins with content://.


I must be missing something since that doesn't seem magical to me.


Now, *this* I didn't expect.  I thought onCreate() was a constructor, i.e.
whenever my app initialized and/or created an object, onCreate() would be
called.  It turns out the onCreate() is called if the datastore doesn't
exist.

I say that because I kept dropping my table in SQLite but the
ContentProvider.onCreate() was never called until I deleted the database
from the hard drive.

I assume all onCreates()s act similarly.




-- 

Faber Fedor
Cloud Computing New Jersey
http://cloudcomputingnj.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to