Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //json
- "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
- //Return the last row (2010).. HELP
- clickMe.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- AlertDialog.Builder mAlert = new AlertDialog.Builder(MainActivity.this);
- mAlert.setTitle("Select Examination Year");
- mAlert.setItems(getCourseYear(), new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int item) {
- Log.e(TAG, arrSession.get(item).toString());
- // MainActivity.getStudentCourse(item);
- }
- });
- mAlert.setCancelable(false);
- mAlert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- //return
- }
- });
- AlertDialog chooceDialog = mAlert.create();
- chooceDialog.show();
- }
- });
- public String[] getCourseYear()
- {
- String[] year = new String[arrSession.size()];
- for (int i = 0; i < arrSession.size(); i++){
- year[i] = arrSession.get(i).getSession_name();
- }
- return year;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement