Most visited

Recently visited

Added in API level 1
Deprecated since API level 17

TwoLineListItem

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.

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

From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View

Inherited constants

From class android.widget.RelativeLayout
From class android.view.ViewGroup
From class android.view.View

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.

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

Public constructors

TwoLineListItem

Added in API level 1
TwoLineListItem (Context context)

Parameters
context Context

TwoLineListItem

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

Parameters
context Context
attrs AttributeSet

TwoLineListItem

Added in API level 1
TwoLineListItem (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context
attrs AttributeSet
defStyleAttr int

TwoLineListItem

Added in API level 21
TwoLineListItem (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context
attrs AttributeSet
defStyleAttr int
defStyleRes int

Public methods

getAccessibilityClassName

Added in API level 23
CharSequence getAccessibilityClassName ()

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.

Returns
CharSequence

getText1

Added in API level 1
TextView getText1 ()

Returns a handle to the item with ID text1.

Returns
TextView A handle to the item with ID text1.

getText2

Added in API level 1
TextView getText2 ()

Returns a handle to the item with ID text2.

Returns
TextView A handle to the item with ID text2.

Protected methods

onFinishInflate

Added in API level 1
void onFinishInflate ()

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.

Hooray!