I was able to obtain the expected function of the SQLiteOpenHelper
method onCreate() with the code below, by including the database name
in the SQLHelper constructor.  Now onCreate() is only called for
databases which are created, and not opened.

public class SQLHelper extends SQLiteOpenHelper{

        public SQLHelper(Context context, String name){
                // constructor
                super(context, name, null, 1);
        }
        public void onCreate(SQLiteDatabase db) {
                LaunchBL.dbCreated = true;



Jim

On Sep 17, 8:03 am, Mark Murphy <[EMAIL PROTECTED]> wrote:
> gymshoe wrote:
> > So does onCreate behave differently than I thought?
>
> If it behaves as you describe, it feels like a bug.
>
> > Is there a better way to do what I want?
>
> I don't know about "better", but in onCreate(), you could check to see
> if your tables exist (select count(*) from sqlite_master where
> name="foo"). I do this as a matter of course, and so that may be why I
> never noticed the issue.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.2 Published!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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