“ArrayAdapter requires the resource ID to be a TextView” XML problems

The ArrayAdapter requires the resource ID to be a TextView XML exception means you don’t supply what the ArrayAdapter expects. When you use this constructor: new ArrayAdapter<String>(this, R.layout.a_layout_file, this.file) R.Layout.a_layout_file must be the id of a xml layout file containing only a TextView(the TextView can’t be wrapped by another layout, like a LinearLayout, RelativeLayout etc!), … Read more

What is “android.R.layout.simple_list_item_1”?

Zakaria, that is a reference to an built-in XML layout document that is part of the Android OS, rather than one of your own XML layouts. Here is a further list of layouts that you can use: http://developer.android.com/reference/android/R.layout.html (Updated link thanks @Estel: https://github.com/android/platform_frameworks_base/tree/master/core/res/res/layout ) You can actually view the code for the layouts.