-2

hi the cursor adapter is throwing error that constructor is not defined ?

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);

and the error is as follows

The constructor SimpleCursorAdapter(MyDatabaseHelper, int, Cursor, String[], int[]) is undefined    MyDatabaseHelper.java
Naseer Ahammed
  • 89
  • 1
  • 2
  • 15
  • 1
    Am I the only one here thinking people should at least read method signature before posting such questions? – Drew Apr 20 '14 at 12:06
  • possible duplicate of [What is Context in Android?](http://stackoverflow.com/questions/3572463/what-is-context-in-android) – CL. Apr 20 '14 at 14:39

1 Answers1

0

Can you try with

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

You can use any other flags instead of CursorAdapter.NO_SELECTION if you want.

Sunny Garg
  • 1,073
  • 1
  • 6
  • 13