Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. InputStream inputStream = getResources().openRawResource(R.raw.invoice);
  2.  
  3. BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
  4.  
  5.  
  6. try {
  7. String csvLine;
  8. while ((csvLine = reader.readLine()) != null)
  9. {
  10. adapter.add(csvLine); //ๆ”พlist็”จ
  11.  
  12. data=csvLine.split(",");
  13. try{
  14. Log.e("Data ",""+data[0]) ;
  15. }catch (Exception e){
  16. Log.e("Problem",e.toString());
  17. }
  18. }
  19. }
  20. catch (IOException ex) {
  21. throw new RuntimeException("Error in reading CSV file: "+ex);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement