Android Studio中带有SQLite的RecyclerView

我正在用android构建待办事项应用程序。 该列表包含任务。 列表中的任务包含(标题,描述)两个字符串,并另存为Task对象在ArrayList中。

重要: 这些任务另存为 ArrayList ,并保存在SQLite数据库中,并显示在RecyclerView中。

当我尝试从数据库取回数据并将其在RecyclerView中列出时,应用程序停止。 我尝试调试代码,并且看到将元素添加到ArrayList“任务”时停止。 我不知道代码中有什么问题。

public static enum TableNamesTest {
    SOME_THING_1("some_thing_1","SomeThing1Class");

    private final String tableName;
    private final String classname;

    private <E,T,G extends Changetable> TableNamesTest(String tableName,String classname,Function<List<E>,Tuple2<List<T>,Integer>> modelConvertFunction,Function<Integer,List<G>> fetchChanges,Class<T> classType) {
        this.tableName = tableName;
        this.classname = classname;
    }

    public String getTableName() {
        return tableName;
    }

    public String getclassname() {
        return classname;
    }
};
typingsoft2 回答:Android Studio中带有SQLite的RecyclerView

我刚刚发现我忘记初始化导致所有问题的ArrayList

本文链接:https://www.f2er.com/3141516.html

大家都在问