1

I'm using SQLIte loader (cwac-loaderex). i'm performing set of operation in a background thread. the operation includes inserting new record, updating the existing one as well as deleting the record.

These operations i'm performing on cursor object like this. these methods are present in loader class & i'm accessing these from my background thread.

@Override
public void Insert(String table, String nullColumnHack,
        ContentValues values) {
mLoader.insert(table, nullColumnHack, values);
}



@Override
public void Update(String table, ContentValues values,
        String whereclause, String[] whereargs) {
    // TODO Auto-generated method stub

    mLoader.update(table, values, whereclause, whereargs);

}

In few scenarios like. Once i insert record, i need the primary key to update another record. i'm failing to get those. Once thread completes its execution the UI will get updated and i'm able to access the required value onPostexecute method. But i want the values soon after i insert to Database.

As per i know, that to reflect the updated values i'm calling the insert, update & delete method directly on Loader object.

How to access the inserted row, in the same thread soon after insert is called?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Naruto
  • 9,476
  • 37
  • 118
  • 201
  • The CWAC-LoaderEx project is discontinued. Further discussion of this topic was moved to https://github.com/commonsguy/cwac-loaderex/issues/15. – CommonsWare May 10 '14 at 11:46

0 Answers0