Tuesday, April 29, 2014
How to add Content Provider manner in SimpleAdapter query multimedia files? ?
How about in
package com.widget.demo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;
public class CompactListDemo extends ListActivity {
@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
SimpleAdapter adapter = new SimpleAdapter (this,
getData (), / / put the data
ListViewR.layout.listitem, / / put the data layout
new String [] {"title", "info", "img"} key
, / / Map collectionnew int [] {R.id.title, R.id.info, R.id.img}) ;/ / with the first four parameters correspond
setListAdapter (adapter);
}
private List
No comments:
Post a Comment