What is "android.R.layout.simple_list_item_1"? What is "android.R.layout.simple_list_item_1"? android android

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.


This is a part of the android OS. Here is the actual version of the defined XML file.

simple_list_item_1:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@android:id/text1"    style="?android:attr/listItemFirstLineStyle"    android:paddingTop="2dip"    android:paddingBottom="3dip"    android:layout_width="fill_parent"    android:layout_height="wrap_content" />

simple_list_item_2:

<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"    android:paddingTop="2dip"    android:paddingBottom="2dip"    android:layout_width="fill_parent"    android:layout_height="wrap_content">    <TextView android:id="@android:id/text1"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        style="?android:attr/listItemFirstLineStyle"/>    <TextView android:id="@android:id/text2"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_below="@android:id/text1"        style="?android:attr/listItemSecondLineStyle" /></TwoLineListItem> 


as answered above by: kcoppock and Joril

go here : https://github.com/android/platform_frameworks_base/tree/master/core/res/res/layout

just right click the layout file you want, then select 'Save As', save somewhere, then copy it in 'layout' folder in your android project(eclipse)...

you can see how the layout looks like :)

way to go...