Skip to content
Snippets Groups Projects
Commit e9f7154e authored by naufal's avatar naufal
Browse files

asdfa

parent 1b07e66b
Branches
No related merge requests found
......@@ -90,7 +90,7 @@ class SettingsFragment : Fragment() {
val titleList = listOf("Makan", "Minum", "Date", "Halo", "Cincin")
randomizeButton.setOnClickListener {
val map = mapOf("title" to Random.nextInt(0, 4 + 1), "nominal" to Random.nextInt(1,1000000 + 1))
val map = mapOf("title" to titleList[Random.nextInt(0, 4 + 1)], "nominal" to Random.nextInt(1,1000000 + 1))
val intent = Intent("com.example.myapplication.ui.transactions.ADD_TRANSACTION")
intent.putExtra("map", HashMap(map))
context?.sendBroadcast(intent)
......
......@@ -19,7 +19,7 @@ class AppBroadcastReceiver : BroadcastReceiver(){
suspend fun insertToDatabase(map : Map<String, String>, transactionRepository: TransactionRepository){
transactionRepository.insertTransactionQuery(
title= map.get("title")!!,
title= map.get("title")!!.toString(),
nominal = map["nominal"]!!.toString(),
kategori = "Randomize",
lokasi = "Unknown"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment