Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. private static List<LinkData> linkDataList = new ArrayList<LinkData>();
  2. private LinkAdapter la;
  3. la = new LinkAdapter(someLinkDataitmes, getActivity());
  4. ListView lv = (ListView) v.findViewById(R.id.urls);
  5. lv.setAdapter(la);
  6.  
  7.  
  8. public class LinkData {
  9. private String name, image, description;
  10.  
  11. public LinkData(String name, String image, String description){
  12. this.name = name;
  13. this.image=image;
  14. this.description=description;
  15. }
  16. }
  17.  
  18. ListView lv = (ListView) v.findViewById(R.id.urls);
  19. LinkAdapter mListAdapter = ((LinkAdapter)lv.getAdapter()); // this line is giving an error.
  20. mListAdapter.add(new LinkData(name_val, image_val, description_val));
  21. mListAdapter.notifyDataSetChanged();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement