Android Programming Press on the image to return to the main documentation page.

SPListView

List of types:

ListView2

ListView2


This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  AddSingleLine (Text As CharSequence)

  AddSingleLine2 (Text As CharSequence, ReturnValue As Object)

  AddTwoLines (Text1 As CharSequence, Text2 As CharSequence)

  AddTwoLines2 (Text1 As CharSequence, Text2 As CharSequence, ReturnValue As Object)

  AddTwoLinesAndBitmap (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap)

  AddTwoLinesAndBitmap2 (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap, ReturnValue As Object)

  Background As android.graphics.drawable.Drawable

  BringToFront

  Clear

  Color As Int [write only]

  Enabled As Boolean

  FastScrollEnabled As Boolean

  GetItem (Index As Int) As Object

  Height As Int

  Initialize (arg1 As String)

  Invalidate

  Invalidate2 (arg0 As android.graphics.Rect)

  Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  IsInitialized As Boolean

  Left As Int

  RemoveAt (Index As Int)

  RemoveView

  RequestFocus As Boolean

  ScrollingBackgroundColor As Int [write only]

  SendToBack

  SetBackgroundImage (arg0 As android.graphics.Bitmap)

  SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)

  SetSelection (Position As Int)

  SingleLineLayout As SingleLineLayout [read only]

  Size As Int [read only]

  Tag As Object

  Top As Int

  TwoLinesAndBitmap As TwoLinesAndBitmapLayout [read only]

  TwoLinesLayout As TwoLinesLayout [read only]

  Visible As Boolean

  Width As Int

Members description:

AddSingleLine (Text As CharSequence)
Adds a single line item.
Example:
ListView1.AddSingleLine("Sunday")
AddSingleLine2 (Text As CharSequence, ReturnValue As Object)
Adds a single line item.
The specified return value will be returned when calling GetItem or in the ItemClick event.
Example:
ListView1.AddSingleLine2("Sunday", 1)
AddTwoLines (Text1 As CharSequence, Text2 As CharSequence)
Adds a two lines item.
Example:
ListView1.AddTwoLines("This is the first line.", "And this is the second")
AddTwoLines2 (Text1 As CharSequence, Text2 As CharSequence, ReturnValue As Object)
Adds a two lines item.
The specified return value will be returned when calling GetItem or in the ItemClick event.
ListView1.AddTwoLines("This is the first line.", "And this is the second", 1)
AddTwoLinesAndBitmap (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap)
Adds a two lines and a bitmap item.
Example:
ListView1.AddTwoLinesAndBitmap("First line", "Second line", LoadBitmap(File.DirAssets, "SomeImage.png"))
AddTwoLinesAndBitmap2 (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap, ReturnValue As Object)
Adds a two lines and a bitmap item.
The specified return value will be returned when calling GetItem or in the ItemClick event.
Example:
ListView1.AddTwoLinesAndBitmap("First line", "Second line", LoadBitmap(File.DirAssets, "SomeImage.png"), 1)
Background As android.graphics.drawable.Drawable
BringToFront
Clear
Clears all items from the list.
Color As Int [write only]
Enabled As Boolean
FastScrollEnabled As Boolean
Gets or sets whether the fast scroll icon will appear when the user scrolls the list.
The default is false.
GetItem (Index As Int) As Object
Returns the value of the item at the specified position.
Returns the "return value" if it was set and if not returns the text of the first line.
Height As Int
Initialize (arg1 As String)
Invalidate
Invalidate2 (arg0 As android.graphics.Rect)
Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
IsInitialized As Boolean
Left As Int
RemoveAt (Index As Int)
Removes the item at the specified position.
RemoveView
RequestFocus As Boolean
ScrollingBackgroundColor As Int [write only]
Sets the background color that will be used while scrolling the list.
This is an optimization done to make the scrolling smoother.
Set to Colors.Transparent if the background behind the list is not solid color.
The default is black.
SendToBack
SetBackgroundImage (arg0 As android.graphics.Bitmap)
SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
SetSelection (Position As Int)
Sets the currently selected item. Calling this method will make this item visible.
If the user is interacting with the list with the keyboard or the wheel button the item will also be visibly selected.
Example: ListView1.SetSelection(10)
SingleLineLayout As SingleLineLayout [read only]
Returns the layout that is used to show single line items.
You can change the layout values to change the appearance of such items.
Example:
Dim Label1 As Label
Label1 = ListView1.SingleLineLayout.Label
Label1.TextSize = 20
Label1.TextColor = Colors.Green
Size As Int [read only]
Returns the number of items stored in the list.
Tag As Object
Top As Int
TwoLinesAndBitmap As TwoLinesAndBitmapLayout [read only]
Returns the layout that is used to show two lines and bitmap items.
You can change the layout values to change the appearance of such items.
For example if you want to remove the second label (in all items with this layout):
ListView1.TwoLinesAndBitmap.SecondLabel.Visible = False
TwoLinesLayout As TwoLinesLayout [read only]
Returns the layout that is used to show two lines items.
You can change the layout values to change the appearance of such items.
Example:
Dim Label1 As Label
Label1 = ListView1.TwoLinesLayout.SecondLabel
Label1.TextSize = 20
Label1.TextColor = Colors.Green
Visible As Boolean
Width As Int

Top