fabrice
- Forum posts: 1
Jun 28, 2012, 11:00:13 PM via Website
Jun 28, 2012 11:00:13 PM via Website
hie,
i m trying to access user calenders and further check current events. until now i m only able to access the number of calender the user has. but i m failing to get out more data from cursor object. here is my code:
i can t figure out what s wrong....
help plz.....
i m trying to access user calenders and further check current events. until now i m only able to access the number of calender the user has. but i m failing to get out more data from cursor object. here is my code:
1int cal_number=0;
2 String[] projection = new String[] { "_id", "name" };
3 Cursor cursor =getContentResolver().query(Uri.parse("content://com.android.calendar/calendars"), projection, null, null, null);
4 cal_number=cursor.getCount();
5 hello.setText("number of cal :"+cal_number);
6 cursor.moveToFirst();
7 String col_names[]=cursor.getColumnNames();
8
9 while(cursor.moveToNext()){
10 hello.append(cursor.getString(2)); //trying to get the data from the third column... total failure...
11 hello.append("\n");
12
13 }
2 String[] projection = new String[] { "_id", "name" };
3 Cursor cursor =getContentResolver().query(Uri.parse("content://com.android.calendar/calendars"), projection, null, null, null);
4 cal_number=cursor.getCount();
5 hello.setText("number of cal :"+cal_number);
6 cursor.moveToFirst();
7 String col_names[]=cursor.getColumnNames();
8
9 while(cursor.moveToNext()){
10 hello.append(cursor.getString(2)); //trying to get the data from the third column... total failure...
11 hello.append("\n");
12
13 }
i can t figure out what s wrong....
help plz.....
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.