How can I give values to ListView? When I am trying to create a ListView using String array, my process is suddently stopped.
public String[] items_list=new String[100];
items_list[0]="11";
items_list[1]="22";
items_list[2]="33";
items_list[3]="44";
ListView listitems=(ListView)findViewById(R.id.list);
adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items_list);
listitems.setAdapter(adapter);
But if i am initializing the string array with ite declaration, it is working. Why this is happend?
public String[] items_list={"chocolate","lime juice","icecreame"};
Please help me... Thnk you..