Join us for ⁠#Android11: The Beta Launch Show on June 3!
Added in API level 1
Deprecated in API level 17

TwoLineListItem

open class TwoLineListItem : RelativeLayout
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.RelativeLayout
   ↳ android.widget.TwoLineListItem

A view group with two children, intended for use in ListViews. This item has two TextViews elements (or subclasses) with the ID values text1 and text2. There is an optional third View element with the ID selectedIcon, which can be any View subclass (though it is typically a graphic View, such as ImageView) that can be displayed when a TwoLineListItem has focus. Android supplies a standard layout resource for TwoLineListView (which does not include a selected item icon), but you can design your own custom XML layout for this object.

Summary

XML attributes

android:mode

Inherited XML attributes

Inherited constants

Public constructors

<init>(context: Context!)

<init>(context: Context!, attrs: AttributeSet!)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods

open CharSequence!

open TextView!

Returns a handle to the item with ID text1.

open TextView!

Returns a handle to the item with ID text2.

Protected methods

open Unit

Inherited functions

Inherited properties

XML attributes

android:mode

android:mode

Public constructors

<init>

Added in API level 1
TwoLineListItem(context: Context!)

<init>

Added in API level 1
TwoLineListItem(
    context: Context!,
    attrs: AttributeSet!)

<init>

Added in API level 1
TwoLineListItem(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

<init>

Added in API level 21
TwoLineListItem(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int,
    defStyleRes: Int)

Public methods

getAccessibilityClassName

Added in API level 23
Deprecated in API level 17
open fun getAccessibilityClassName(): CharSequence!

Deprecated.

getText1

Added in API level 1
Deprecated in API level 17
open fun getText1(): TextView!

Deprecated.

Returns a handle to the item with ID text1.

Return
TextView! A handle to the item with ID text1.

getText2

Added in API level 1
Deprecated in API level 17
open fun getText2(): TextView!

Deprecated.

Returns a handle to the item with ID text2.

Return
TextView! A handle to the item with ID text2.

Protected methods

onFinishInflate

Added in API level 1
Deprecated in API level 17
protected open fun onFinishInflate(): Unit

Deprecated.