0
我大約一個星期前開始了android開發,並且我使用listview爲一個小應用程序從xml文件中獲取數據,在遠程服務器上獲取名稱,日期,細節,圖像網址)一切正常,除了沒有顯示任何內容的imageview。 這裏是我使用的代碼:在ListView中設置ImageViews src
public class ActivityListViewActivity extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
XMLParser parse = new XMLParser();
//this is where i get my data from the xml file
ArrayList<HashMap<String, String>> newsList = parse.StartParsing();
ListAdapter adaptor = new SimpleAdapter(this, newsList, R.layout.list_item
, new String[] {"name", "description", "date", "details", "image"}, new int[] {
R.id.name, R.id.description, R.id.date, R.id.details, R.id.image});
this.setListAdapter(adaptor);
你有沒有通過http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-i-i---viewview/3068012#3068012 – 2011-12-28 11:13:44
Loading image from網址或其他? – 2011-12-28 11:15:56
如果從URL加載圖片,請與@VivekKalkur提到的示例保持一致。 – 2011-12-28 11:16:18