How can I trigger sendBroadcast after sqlite insert/update finish? BroadCastReceiver get broadcast corretly.
This is how I do it, but sendBroadcast fires before insert/update finishes.
public static final String ACTION = "mycusomactionstring";
DBDatabase db = new DBDatabase(this);
String table = "myTable";
int key = 1;
String value = "value";
// This executes insert/update to SQLite
db.add(table, key, value);
Intent in = new Intent(ACTION);
LocalBroadcastManager.getInstance(context).sendBroadcast(in);
Aucun commentaire:
Enregistrer un commentaire