{"action":"closed","issue":{"url":"https://api.github.com/repos/systers/PCSA-Android/issues/167","repository_url":"https://api.github.com/repos/systers/PCSA-Android","labels_url":"https://api.github.com/repos/systers/PCSA-Android/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/systers/PCSA-Android/issues/167/comments","events_url":"https://api.github.com/repos/systers/PCSA-Android/issues/167/events","html_url":"https://github.com/systers/PCSA-Android/issues/167","id":142083109,"number":167,"title":"comrades hard coded at Trustees.java","user":{"login":"mari-linhares","id":8157164,"avatar_url":"https://avatars.githubusercontent.com/u/8157164?v=3","gravatar_id":"","url":"https://api.github.com/users/mari-linhares","html_url":"https://github.com/mari-linhares","followers_url":"https://api.github.com/users/mari-linhares/followers","following_url":"https://api.github.com/users/mari-linhares/following{/other_user}","gists_url":"https://api.github.com/users/mari-linhares/gists{/gist_id}","starred_url":"https://api.github.com/users/mari-linhares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mari-linhares/subscriptions","organizations_url":"https://api.github.com/users/mari-linhares/orgs","repos_url":"https://api.github.com/users/mari-linhares/repos","events_url":"https://api.github.com/users/mari-linhares/events{/privacy}","received_events_url":"https://api.github.com/users/mari-linhares/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systers/PCSA-Android/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-19T17:20:50Z","updated_at":"2016-04-06T15:44:55Z","closed_at":"2016-04-06T15:44:55Z","body":"I was wondering if instead of objects defined individually I could create a list of contacts in order to avoid code repetition.\r\n\r\nFor example: \r\n  //Retrieving stored values\r\n                old_comrade1 = sharedpreferences.getString(comrade1,\"\");\r\n                old_comrade2 = sharedpreferences.getString(comrade2,\"\");\r\n                old_comrade3 = sharedpreferences.getString(comrade3,\"\");\r\n                old_comrade4 = sharedpreferences.getString(comrade4,\"\");\r\n                old_comrade5 = sharedpreferences.getString(comrade5,\"\");\r\n                old_comrade6 = sharedpreferences.getString(comrade6, \"\");\r\n\r\nNow would be something like:\r\n\r\n             for(in i = 1; i <= NUMBER_OF_COMRADES; i++)\r\n                    old_comrade[i] = sharedpreferences.getString(comrade[i], \"\");\r\n"}}