I used custom xml file for listview.
i create two textview in listview but only five items are displaying on screen.
What is the problem? why not all items are displaying?
public class MyCustomListView extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.custom_list_view);
SimpleAdapter adapter = new SimpleAdapter(this,list,R.layout.custom_row_view,
new
String[] {"name","height"},
new int[] {R.id.text1,R.id.text2}
);
populateList();
setListAdapter(adapter);
}
static final ArrayList<HashMap<String,String>> list =
new ArrayList<HashMap<String,String>>();
private void populateList() {
HashMap<String,String> temp = new HashMap<String,String>();
temp.put("name","Chavand");
temp.put("height", "3400ft");
list.add(temp);
HashMap<String,String> temp1 = new HashMap<String,String>();
temp1.put("name","Durg-Dhakoba");
temp1.put("height", "3900ft & 4100ft");
list.add(temp1);
HashMap<String,String> temp2 = new HashMap<String,String>();
temp2.put("name","Hadsar");
temp2.put("height", "3200ft");
list.add(temp2);
HashMap<String,String> temp3 = new HashMap<String,String>();
temp3.put("name","Jivdhan");
temp3.put("height", "3754ft");
list.add(temp3);
HashMap<String,String> temp4 = new HashMap<String,String>();
temp4.put("name","Korigad");
temp4.put("height", "3000ft");
list.add(temp4);
HashMap<String,String> temp5 = new HashMap<String,String>();
temp.put("name","Lohgad");
temp.put("height", "3400ft");
list.add(temp5);
HashMap<String,String> temp6 = new HashMap<String,String>();
temp.put("name","Malhargad");
temp.put("height", "3100ft");
list.add(temp6);
HashMap<String,String> temp7 = new HashMap<String,String>();
temp.put("name","Shivneri");
temp.put("height", "3500ft");
list.add(temp7);
HashMap<String,String> temp8 = new HashMap<String,String>();
temp.put("name","Visapur");
temp.put("height", "3038ft");
list.add(temp8);
}