Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. //json
  2. "session":[{"session_id":"11","session_name":"2013","is_current":"0","lastAccess":"2014-08-27 11:30:40"}, {"session_id":"12","session_name":"2012","is_current":"0","lastAccess":"2014-08-27 12:33:56"}, {"session_id":"13","session_name":"2011","is_current":"0","lastAccess":"2014-08-27 12:42:09"}, {"session_id":"14","session_name":"2010","is_current":"0","lastAccess":"2014-08-27 12:42:20"}]// practezer.subject
  3.  
  4. //Return the last row (2010).. HELP
  5. clickMe.setOnClickListener(new View.OnClickListener() {
  6. @Override
  7. public void onClick(View v) {
  8. AlertDialog.Builder mAlert = new AlertDialog.Builder(MainActivity.this);
  9. mAlert.setTitle("Select Examination Year");
  10. mAlert.setItems(getCourseYear(), new DialogInterface.OnClickListener() {
  11. @Override
  12. public void onClick(DialogInterface dialog, int item) {
  13. Log.e(TAG, arrSession.get(item).toString());
  14. // MainActivity.getStudentCourse(item);
  15. }
  16. });
  17. mAlert.setCancelable(false);
  18. mAlert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  19. @Override
  20. public void onClick(DialogInterface dialog, int which) {
  21. //return
  22. }
  23. });
  24. AlertDialog chooceDialog = mAlert.create();
  25. chooceDialog.show();
  26. }
  27. });
  28.  
  29.  
  30. public String[] getCourseYear()
  31. {
  32. String[] year = new String[arrSession.size()];
  33. for (int i = 0; i < arrSession.size(); i++){
  34. year[i] = arrSession.get(i).getSession_name();
  35. }
  36. return year;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement