Guest User

Untitled

a guest
Oct 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. String[] projections = new String [] {
  2. WorldClock.Columns.CITY_UID,
  3. WorldClock.Columns.NAME,
  4. WorldClock.Columns.LONGITUDE,
  5. WorldClock.Columns.TIMEZONE
  6. }
  7.  
  8. String selection = WorldClock.Columns.TIMEZONE + " = '?'";
  9.  
  10. String[] selectionArgs = new String[] {"Asia/Tokyo"};
  11.  
  12. // Sort data by WorldClock.Columns.CITY_UID
  13. Cursor cur = WorldClock.query(getContext().getContentResolver(),
  14. projections,
  15. selection,
  16. selectionArgs,
  17. WorldClock.Columns.CITY_UID
  18. );
  19.  
  20. while (cur.moveToNext()) {
  21. WorldClock.Location wlc = WorldClock.getLocationFromCursor(cur);
  22.  
  23. // Do something useful with the value.
  24. }
Add Comment
Please, Sign In to add comment