Android APIs
public class

TwoLineListItem

extends RelativeLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.RelativeLayout
         ↳ android.widget.TwoLineListItem

This class was deprecated in API level 17.
This class can be implemented easily by apps using a RelativeLayout or a LinearLayout.

Class Overview

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
Attribute Name Related Method Description
android:mode  
[Expand]
Inherited XML Attributes
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Constants
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
TwoLineListItem(Context context)
TwoLineListItem(Context context, AttributeSet attrs)
TwoLineListItem(Context context, AttributeSet attrs, int defStyleAttr)
TwoLineListItem(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
CharSequence getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes.
TextView getText1()
Returns a handle to the item with ID text1.
TextView getText2()
Returns a handle to the item with ID text2.
Protected Methods
void onFinishInflate()
Finalize inflating a view from XML.
[Expand]
Inherited Methods
From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

XML Attributes

android:mode

Related Methods

Public Constructors

public TwoLineListItem (Context context)

Added in API level 1

public TwoLineListItem (Context context, AttributeSet attrs)

Added in API level 1

public TwoLineListItem (Context context, AttributeSet attrs, int defStyleAttr)

Added in API level 1

public TwoLineListItem (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Added in API level 21

Public Methods

public CharSequence getAccessibilityClassName ()

Added in API level 23

Return the class name of this object to be used for accessibility purposes. Subclasses should only override this if they are implementing something that should be seen as a completely new class of view when used by accessibility, unrelated to the class it is deriving from. This is used to fill in AccessibilityNodeInfo.setClassName.

public TextView getText1 ()

Added in API level 1

Returns a handle to the item with ID text1.

Returns
  • A handle to the item with ID text1.

public TextView getText2 ()

Added in API level 1

Returns a handle to the item with ID text2.

Returns
  • A handle to the item with ID text2.

Protected Methods

protected void onFinishInflate ()

Added in API level 1

Finalize inflating a view from XML. This is called as the last phase of inflation, after all child views have been added.

Even if the subclass overrides onFinishInflate, they should always be sure to call the super method, so that we get called.