08.12.2010 18:15, Psyhclo пишет:
Hi, I want to use the SQLiteDatabase insert() method in an Activity.
For this, I need the SQLiteDatabase object. How can I have this object
in the Activity? I mean, how to iniciate it in the Activity

No, unless you're creating a ContentProvider, there isn't anything special to do in the manifest.

, or I
should have it on a class that extends SQLiteOpenHelper class?

Yes, that's one possible way.

If I
can use it on the Activity directly, what should I do, how to
instantiate and initialize the object. Thanks!

Subclass SQLiteOpenHelper as per the documentation:

http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html

Then call getReadableDatabase / getWritableDatabase and use it to read / write data.

--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to