I have 2 tables: 1. Cities 2. Forecasts the tables are currently linked by 2 fields: city and country. and in relation of one to many (many forecasts per one city) each table is updated in a deferent fragmentActivity and both are displayed in the main activity. both get data from parsing JSONs I have another activity of the cities list. if a city is deleted from the cities list, it is deleted from CITIES table by id (by onLongClick event in the recyclerView) the problem is that - the relevant forecasts in Forecasts Table should be deleted as well. what is the current solution? THANKS! BTW - if it wasn't clear by now - I'm new to android. ;)
Asked
Active
Viewed 20 times
0
-
1How about running **2** `DELETE` commands, one on each table? Possibly, encapsulated in a transacion. – Phantômaxx Mar 02 '17 at 16:37
-
@Rotwang I have only the id for the entry in Cities table – getandrid Mar 02 '17 at 17:47
-
How do you link the tables? There must be a field (possibly, an `id`) on which you make the JOIN. Use that field to delete both tables. – Phantômaxx Mar 03 '17 at 08:54