I have since figured out an ugly but working fix for this:

ArrayList<String> LoseTables = new ArrayList<String>();
                LoseTables.add(CHAR1);//static import
                LoseTables.add(CHAR2);//static import
                LoseTables.add(CHAR3);//static import
                LoseTables.add(CHAR4);//static import
                ContentValues values = new ContentValues();
                for (int i = 0; i < 4; i++) {
                        mCursor = db.query(LoseTables.get(i), new String[] { 
_11, _22,
_33, }, "_id = 1", null, null, null, null, null);
                        mCursor.moveToFirst();
                        if (mCursor.getString(0).equals("X")) {
                        } else {
                                if (LoseTables.get(i) == CHAR1) {
                                        values.put(_22, "1");
                                        values.put(_33, "1");
                                } else {
                                        values.clear();
                                        values.put(_22, "0");
                                        values.put(_33, "0");
                                }
                                db.update(LoseTables.get(i), values, null, 
null);
                        }
                }

It's not pretty, but it gets the job done, should work if you have a
lot of tables all requiring similar action.

Regards,
Ben
http://defiledroid.wordpress.com/

On Mar 9, 7:58 pm, Ben <[email protected]> wrote:
> I am trying to throw 4 tables into a List<table> and then run a query
> on each through a loop... this isn't really working...
>
> Following code totally freehand as I had to undo the code I wrote
> because it wouldn't run :
>
> //this first line is the one that I would imagine is the linchpin on
> getting this to work
> List<table> mTables = new List<table>();
> mTable.add("character1")
> //add character 2
> //add character 3
> //add character 4
>
> for (int i = 0; i < 4; i++) {
>
> mCursor = db.query(mTables.get(i), null null.......);
> mCursor.movetofirst;
>
> //use ContentValue to update a few fields
>
> }
>
> I was checking out the 
> SQLiteQueryBuilderhttp://developer.android.com/reference/android/database/sqlite/SQLite...
> - but it didnt quite seem to be what i was looking for.
>
> Is this possible/feasible? Any help would be much appreciated.
>
> Respectfully,
> Ben
>
> https://sites.google.com/site/defiledroid/

-- 
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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to