public class

TwoLineListItem

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

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
Public Constructors
TwoLineListItem(Context context)
TwoLineListItem(Context context, AttributeSet attrs)
TwoLineListItem(Context context, AttributeSet attrs, int defStyle)
Public Methods
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.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent

XML Attributes

android:mode

Related Methods

Public Constructors

public TwoLineListItem (Context context)

public TwoLineListItem (Context context, AttributeSet attrs)

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

Public Methods

public TextView getText1 ()

Returns a handle to the item with ID text1.

Returns
  • A handle to the item with ID text1.

public TextView getText2 ()

Returns a handle to the item with ID text2.

Returns
  • A handle to the item with ID text2.

Protected Methods

protected 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.