Want more features on Pastebin? Sign Up, it's FREE!
Guest

Listview.java

By: a guest on Dec 11th, 2011  |  syntax: Java  |  size: 1.16 KB  |  views: 133  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public View getView(int position, View convertView, ViewGroup parent) {
  2.                 View vi = convertView;
  3.                 if (convertView == null)
  4.                         vi = inflater.inflate(R.layout.item, null);
  5.  
  6.                 TextView text = (TextView) vi.findViewById(R.id.message);
  7.                 String messsage = "<div class=\"description\">  Social networking sites across the world are all thumbs up for this new song ‘Kolaveri Di’ sung\" </div>";
  8.  
  9.                 org.jsoup.nodes.Document document = Jsoup.parse(messsage);
  10.                 Elements elements = document.select("div.description");
  11.                 text.setText("" + elements.text());
  12.  
  13.                 TextView name = (TextView) vi.findViewById(R.id.name);
  14.                 String nameurl = "<div class=\"actorDescription\"><a class=\"actorName\" href=\"http://www.facebook.com/profile.php?id=1685342316\" data-hovercard=\"/ajax/hovercard/user.php?id=1087454171\" saprocessedanchor=\"true\">Raghav Rajagopalan</a> </div>";
  15.  
  16.                 Document docu = Jsoup.parse(nameurl);
  17.                 Elements element = docu.select("div.actorDescription");
  18.                 name.setText("" + element.text());
  19.  
  20.                 ImageView image = (ImageView) vi.findViewById(R.id.image);
  21.                 // text.setText("item " + position);
  22.                 imageLoader.DisplayImage(data[position], image);
  23.                 return vi;
  24.         }
  25.  
clone this paste RAW Paste Data