Reputation: 51
So I'm developer and currently working on an android to-do list app.
I'm looking for a way to store the date entered by the user:
Is there is a way to create variables dynamically ? (e.g. task1, task2, etc..)
Or should I work with 3 arrays for the time, title, description.
For example:
Time = ["5pm","4:15pm","6:30am"]
Title = ["Pick up the kids","meet Ammy"]
Thank you.
Upvotes: 0
Views: 60
Reputation: 51441
How about creating a class Task and keep them in a list?
data class Task(val title: String, val time: String)
val tasks = listOf(Task(“Meet Amy”, “5pm”), Task(“Pick up kids”, “3pm”)
Upvotes: 2