Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. "data": {
  2.  
  3. "mData": [
  4. {
  5. "Field1": 262,
  6. "Field2": 6695,
  7. },
  8. {
  9. "Field1": 252,
  10. "Field2": 3295,
  11. }
  12. ]
  13. },
  14. "errors": false}
  15.  
  16. LinearLayout parentLayout = (LinearLayout)findViewById(R.id.layout);
  17.  
  18. LayoutInflater layoutInflater = getLayoutInflater();
  19. View view;
  20.  
  21. for (int i = 1; i < jsonObjctsCount; i++){
  22. // Add the text layout to the parent layout
  23. view = layoutInflater.inflate(R.layout.text_layout, parentLayout, false);
  24.  
  25. // In order to get the view we have to use the new view with text_layout in it
  26. TextView textView = (TextView)view.findViewById(R.id.text);
  27. textView.setText("Row " + i);
  28.  
  29. // Add the text view to the parent layout
  30. parentLayout.addView(textView);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement