Sofia API Reference

  • Package Index
  • Class Index
  • Packages
  • sofia.app
  • sofia.content
  • sofia.data
  • sofia.graphics
  • sofia.util
  • sofia.view
  • sofia.widget
    • Classes
    • AutoCompleteTextView
    • DecoratingAdapter
    • ListView
    • Spinner
    • Annotations
    • ProvidesSubtitle
    • ProvidesTitle

public class
AutoCompleteTextView

extends AutoCompleteTextView

Inheritance

  • java.lang.Object
    • android.widget.AutoCompleteTextView
      • sofia.widget.AutoCompleteTextView<E>

Class Overview

A subclass of android.widget.AutoCompleteTextView that is easier to use. It provides methods like those in the List interface (add, remove, get, and set, among others) to manipulate the contents of the list, as well as an accessor method getList() that returns a List that automatically refreshes the list when its structure is changed.


Summary

Public Constructors
AutoCompleteTextView(Context context)
Creates a new AutoCompleteTextView.
AutoCompleteTextView(Context context, AttributeSet attrs)
Creates a new AutoCompleteTextView.
AutoCompleteTextView(Context context, AttributeSet attrs, int defStyle)
Creates a new AutoCompleteTextView.
Public Methods
void add(int index, E item)
Inserts an item into the text view at the specified index.
boolean add(E item)
Adds an item to the text view.
boolean addAll(int index, Collection<? extends E> collection)
Inserts the items in the specified collection into the text view at the specified index.
boolean addAll(Collection<? extends E> collection)
Adds the items in the specified collection to the text view.
void clear()
Removes all items from the text view.
E get(int index)
Gets the element at the specified index from the text view.
List<E> getList()
Gets the list of items that is managed by this text view.
void refresh()
Refreshes the text view to update its contents from the list it manages.
E remove(int index)
Removes the item at the specified index from the text view.
boolean remove(E item)
Removes the specified item from the text view.
E set(int index, E item)
Replaces the element at the specified index from the text view with another item.
Methods inherited from class java.lang.Object
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait()
final void wait(long arg0, int arg1)
final void wait(long arg0)

Public Constructors

public AutoCompleteTextView (Context context)

Creates a new AutoCompleteTextView.

Parameters
context
the context
public AutoCompleteTextView (Context context, AttributeSet attrs)

Creates a new AutoCompleteTextView.

Parameters
context
the context
attrs
the attribute set from the layout XML file
public AutoCompleteTextView (Context context, AttributeSet attrs, int defStyle)

Creates a new AutoCompleteTextView.

Parameters
context
the context
attrs
the attribute set from the layout XML file
defStyle
the default style ID

Public Methods

public void add (int index, E item)

Inserts an item into the text view at the specified index.

Parameters
index
the index where the new item should be inserted
item
the item to add to the text view
public boolean add (E item)

Adds an item to the text view.

Parameters
item
the item to add to the text view
Returns

true if the item could be added, or false if it could not

public boolean addAll (int index, Collection<? extends E> collection)

Inserts the items in the specified collection into the text view at the specified index.

Parameters
index
the index where the new items should be inserted
collection
the items to add to the text view
Returns

true if the items could be added, or false if they could not

public boolean addAll (Collection<? extends E> collection)

Adds the items in the specified collection to the text view.

Parameters
collection
the items to add to the text view
Returns

rue if the items could be added, or false if they could not

public void clear ()

Removes all items from the text view.

public E get (int index)

Gets the element at the specified index from the text view.

Parameters
index
the index of the item to retrieve
Returns

the item at the specified index

public List<E> getList ()

Gets the list of items that is managed by this text view. Changes made to the structure of the list returned by this method (that is, adding, removing, or replacing items) will be immediately reflected in the list view. You only need to explicitly refresh() the list if you make a change to an element inside the list without directly modifying the list itself.

Returns

the List of items managed by this text view

public void refresh ()

Refreshes the text view to update its contents from the list it manages. This method does not need to be called after methods like add or remove -- it only needs to be called if you change a property of one of the elements in the list (for example, by calling a setter) without modifying the structure of the list itself.

public E remove (int index)

Removes the item at the specified index from the text view.

Parameters
index
the index of the item to be removed
Returns

the item that was removed

public boolean remove (E item)

Removes the specified item from the text view.

Parameters
item
the item to remove from the text view
Returns

true if the item was found and removed, or false if it was not

public E set (int index, E item)

Replaces the element at the specified index from the text view with another item.

Parameters
index
the index of the item to retrieve
item
the item to put into the list
Returns

the item previously at the specified index