【发布时间】:2026-02-23 20:00:02
【问题描述】:
我有一个任务应用程序。
它的表是由
创建的String createTable = "CREATE TABLE " + TaskContract.TaskEntry.TABLE + " ( " +
TaskContract.TaskEntry._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
TaskContract.TaskEntry.COL_TASK_TITLE + " TEXT NOT NULL);";
我的目标是使用列表视图适配器在列表视图中列出这些项目,以便将相似的TASK_TITLEs 组合在一起。
示例列表视图
Go running 2 times
40 tomatoes
Go running 5 times
Go hunting
Buy two running shoes
tomatoes, 400g
应该是
Go running 2 times
Go running 5 times
Buy two running shoes
40 tomatoes
tomatoes, 400g
Go hunting
作为
Go running 2 times
Go running 5 times
Buy two running shoes
包含running 和
40 tomatoes
tomatoes, 400g
包含tomatoes
【问题讨论】:
-
你很努力,但你的问题现在还不够清楚。你可以说得更详细点吗 ?也可以添加几行数据。
-
如果
Buy two running shoes的值不是Buy two running tomatoes怎么办?你想过所有的可能性吗? -
@forpas 感谢您的提示。在你写完之后,我意识到这可以通过名词和动词来解决。动词的排名低于名词。因此,
Buy two running tomatoes将转到tomatoes,而不是running。 -
您是否有某种可以存储在 SQLite 数据库中的字典,其中单词可以定义为名词、动词等?因为据我所知,在这个级别的 Android 应用程序编程中,没有办法区分这些类别。
-
@ADM 够具体了。
标签: android sqlite android-sqlite android-arrayadapter