File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
app/src/main/java/com/waldo121 Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ class MainActivity : ComponentActivity() {
137137 appDatabase = MatchRecordsDatabase .getDatabase(this )
138138
139139 lifecycleScope.launch {
140- val path = exportRoomDatabase(this @MainActivity, MyRoomDatabase .getInstance( this @MainActivity) )
140+ val path = exportRoomDatabase(this @MainActivity, appDatabase )
141141 Toast .makeText(this @MainActivity, " Export terminé : $path " , Toast .LENGTH_LONG ).show()
142142 }
143143
Original file line number Diff line number Diff line change @@ -9,13 +9,12 @@ import kotlinx.coroutines.withContext
99import java.io.File
1010
1111// Fonction d'export complète
12- suspend fun exportRoomDatabase (context : Context , db : MyRoomDatabase ) = withContext(Dispatchers .IO ) {
12+ suspend fun exportRoomDatabase (context : Context , db : MatchRecordsDatabase ) = withContext(Dispatchers .IO ) {
1313 val gson = GsonBuilder ().setPrettyPrinting().create()
1414
1515 // 🔹 Récupère les données de chaque DAO
16- val users = db.userDao().getAll()
17- val orders = db.orderDao().getAll()
18- val products = db.productDao().getAll()
16+ val singleMatches = db.singleMatchRecordDao().getAll()
17+ val doubleMatches = db.DoubleMatchRecordDao ().getAll()
1918
2019 // 🔹 Mets tout dans un seul objet
2120 val exportData = mapOf (
You can’t perform that action at this time.
0 commit comments