0

In android application I am using adapter for populating ListView control like below:

public class ChildActivity extends ActionBarActivity implements GetChildList {

    private ListView lv_child;
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_child);

        List<String> array = new ArrayList<String>();   // for e.g array ["num1", "num2"]
        lv_child = (ListView)findViewById(R.id.lv_child); 
        ArrayAdapter<String> adapterChild = new ArrayAdapter<String>(ChildActivity.this,  android.R.layout.simple_list_item_1,array);
        lv_child.setAdapter(adapterChild);

}
}

but i don't understand where its is simple_list_item_1 declare at this line ArrayAdapter<String> adapterChild = new ArrayAdapter<String>(ChildActivity.this, android.R.layout.simple_list_item_1,array);

Kindly suggest me, waiting for reply.

user3514596
  • 47
  • 1
  • 6
  • Android provides some standard list items, hence the android.R tag instead of your local resources from R. If you ctrl click it, it should show you the structure. You can also create your own xml and inflate that instead. – G_V Dec 02 '14 at 14:11
  • I have a problem at this `http://stackoverflow.com/questions/27249535/fatal-exception-main-android-java?noredirect=1#comment42974015_27249535`. how can i resolve this issue, I am stuck up on it. – user3514596 Dec 02 '14 at 14:27
  • You seem to be passing an empty array of values there. You might just be better off writing your own adapter. https://www.youtube.com/watch?v=wDBM6wVEO70 explains a bunch of cool stuff about it – G_V Dec 02 '14 at 14:33

0 Answers0