Answer the question
In order to leave comments, you need to log in
How can Android use LoaderManager to track sqlite view changes?
Good evening.
I am developing for Android, I ran into a problem.
The project uses sqlite: work tables, lookup tables and a view to display the finished data.
Task: it is necessary to update the data in the table, and dynamically track / display changes in the associated view (view). I use LoaderManager for this, following the example from the article . On a clean table, everything works fine. But if you initialize a view instead of a table in the loader, the loader does not track changes in the data (onLoadFinished is not called).
Table:
CREATE TABLE [table_scan] (
[_id] INTEGER PRIMARY KEY AUTOINCREMENT,
[NR_ID] INTEGER NOT NULL,
[T_ID] INTEGER NOT NULL,
[Color_ID] INTEGER NOT NULL,
[R_ID] INTEGER NOT NULL,
[Barcode] TEXT NOT NULL,
[NumberSeat] INTEGER,
[Date] DATETIME NOT NULL DEFAULT(DATETIME('now', 'localtime')),
[Deleted] INTEGER NOT NULL DEFAULT '0',
[Status] INTEGER NOT NULL DEFAULT '0',
[Export] INTEGER NOT NULL DEFAULT '0');
CREATE VIEW [view_scan] AS SELECT _id, Barcode, Status, Deleted, NumberSeat,
goods_catalog.T_Articul, colors_catalog.Color_Name, sizes_catalog.R_Name
FROM table_scan
INNER JOIN goods_catalog ON goods_catalog.T_ID = table_scan.T_ID
INNER JOIN colors_catalog ON colors_catalog.Color_ID = table_scan.Color_ID
INNER JOIN sizes_catalog ON sizes_catalog.R_ID = table_scan.R_ID
WHERE Deleted = 0;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question