Created
June 5, 2012 23:10
-
-
Save iewnait/2878707 to your computer and use it in GitHub Desktop.
Example code for WorldClock.query(ContentResolver cr, String[] projection)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set this to null to get all Column. | |
String[] projections = new String [] { | |
WorldClock.Columns.CITY_UID, | |
WorldClock.Columns.NAME, | |
WorldClock.Columns.LONGITUDE, | |
WorldClock.Columns.TIMEZONE | |
}; | |
Cursor cur = WorldClock.query(getContext().getContentResolver(), | |
projections | |
); | |
while (cur.moveToNext()) { | |
for (int i = 0; i <cur.getColumnCount(); i++) { | |
WorldClock.Location wcl = WorldClock.getLocationFromCursor(cur); | |
// Do something useful with the ID and NAME of the calendars. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment