我想在Android中创建一个任务列表。 所以,我创建了一个名为Task的类,这个类有一些属性(Name,Date,description)。 我也创建了一个TaskList,这个列表扩展了TreeSet。
我想在Android中显示此列表,我不知道如何。 将来我希望当用户点击任务时,他可以更改属性。
什么是正确的? 为任务创建片段? 使用ListAdapter作为任务列表? 什么是最好的方法? 请给我正确的方法来实现这一点,我将搜索代码
我希望看起来像:
................
任务1
去上大学
日期:07/04/2016
................
任务2
买水
日期:2016年4月8日
...............
任务3
读一本书
日期:2016年4月9日
...............
谢谢!
I want to create a list of tasks in Android. So, i have created a Class named Task, this class have this some properties (Name, Date, description). And I have created a TaskList too, this list extends TreeSet.
I want to show this list in Android, and I don't know how. In the future I want that when the user click on the task, he can change the properties.
What is correct to do? Create a Fragment for Task? Use ListAdapter for the List of Tasks? What is the best way? Please give me the right way to implement this and I will search to code it
I wish that looks like:
................
Task 1
Go to college
Date: 07/04/2016
................
Task 2
Buy a water
Date: 08/04/2016
...............
Task 3
Read a book
Date: 09/04/2016
...............
Thanks!
最满意答案
使用Recyclerview。 它比ListView更好,并在添加和删除项目时提供默认动画。 这里有一个完整的例子
Use Recyclerview. It's better than ListView and provides default animations while adding and removing items. A complete example can be found here
更多推荐
发布评论