SimpleCursoradapter抛出错误?

时间:2014-04-20 11:57:45

标签: android sqlite

你好,游标适配器抛出了没有定义构造函数的错误吗?

String[] from = { "hour", "minute" };

        int[] to = { android.R.id.text1,android.R.id.text2 };

        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
                android.R.layout.activity_list_item, getAlarm, from, to);

,错误如下

The constructor SimpleCursorAdapter(MyDatabaseHelper, int, Cursor, String[], int[]) is undefined    MyDatabaseHelper.java

1 个答案:

答案 0 :(得分:0)

你可以试试吗

SimpleCursorAdapter adapter = new SimpleCursorAdapter(YourActivityName.this,
            android.R.layout.activity_list_item, getAlarm, from, to, CursorAdapter.NO_SELECTION);

如果需要,您可以使用任何其他标志而不是CursorAdapter.NO_SELECTION。