Advertisement
vitareinforce

olah csv dari buffered reader

Feb 8th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. /**
  2. * Download From CSV and put to Container
  3. * @param in Buffered Reader from downloading CSV
  4. * @throws IOException
  5. */
  6. private void fillData(BufferedReader in) throws IOException {
  7.  
  8. int i = 0;
  9. postList.clear();
  10. CSVReader reader = new CSVReader(in);
  11. Post post;
  12. String[] nextRecord;
  13. while ((nextRecord = reader.readNext()) != null) {
  14. if(i > 0) {
  15. post = new Post("http://filehosting.pptik.id/Bawaslu-Ftp-Testing/" + nextRecord[0],
  16. nextRecord[1],
  17. nextRecord[3],
  18. nextRecord[4],
  19. nextRecord[5],
  20. nextRecord[8]
  21. );
  22. postList.add(post);
  23. }
  24. i = i + 1;
  25. }
  26. pAdapter.notifyDataSetChanged();
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement