IT. Expert System.

Android Reference

CursorAdapter


android.widget

Class CursorAdapter

    • Field Detail

      • mDataValid

        protected boolean mDataValid
        This field should be made private, so it is hidden from the SDK.
      • mAutoRequery

        protected boolean mAutoRequery
        This field should be made private, so it is hidden from the SDK.
      • mCursor

        protected Cursor mCursor
        This field should be made private, so it is hidden from the SDK.
      • mContext

        protected Context mContext
        This field should be made private, so it is hidden from the SDK.
      • mRowIDColumn

        protected int mRowIDColumn
        This field should be made private, so it is hidden from the SDK.
      • mChangeObserver

        protected android.widget.CursorAdapter.ChangeObserver mChangeObserver
        This field should be made private, so it is hidden from the SDK.
      • mDataSetObserver

        protected DataSetObserver mDataSetObserver
        This field should be made private, so it is hidden from the SDK.
      • mCursorFilter

        protected android.widget.CursorFilter mCursorFilter
        This field should be made private, so it is hidden from the SDK.
      • mFilterQueryProvider

        protected FilterQueryProvider mFilterQueryProvider
        This field should be made private, so it is hidden from the SDK.
      • FLAG_AUTO_REQUERY

        @Deprecated
        public static final int FLAG_AUTO_REQUERY
        Deprecated. This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors. As an alternative, use LoaderManager with a CursorLoader.
        If set the adapter will call requery() on the cursor whenever a content change notification is delivered. Implies FLAG_REGISTER_CONTENT_OBSERVER.
        See Also:
        Constant Field Values
      • FLAG_REGISTER_CONTENT_OBSERVER

        public static final int FLAG_REGISTER_CONTENT_OBSERVER
        If set the adapter will register a content observer on the cursor and will call onContentChanged() when a notification comes in. Be careful when using this flag: you will need to unset the current Cursor from the adapter to avoid leaks due to its registered observers. This flag is not needed when using a CursorAdapter with a CursorLoader.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CursorAdapter

        @Deprecated
        public CursorAdapter(Context context,
                                Cursor c)
        Deprecated. This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors. As an alternative, use LoaderManager with a CursorLoader.
        Constructor that always enables auto-requery.
        Parameters:
        c - The cursor from which to get the data.
        context - The context
      • CursorAdapter

        public CursorAdapter(Context context,
                     Cursor c,
                     boolean autoRequery)
        Constructor that allows control over auto-requery. It is recommended you not use this, but instead CursorAdapter(Context, Cursor, int). When using this constructor, FLAG_REGISTER_CONTENT_OBSERVER will always be set.
        Parameters:
        c - The cursor from which to get the data.
        context - The context
        autoRequery - If true the adapter will call requery() on the cursor whenever it changes so the most recent data is always displayed. Using true here is discouraged.
      • CursorAdapter

        public CursorAdapter(Context context,
                     Cursor c,
                     int flags)
        Recommended constructor.
        Parameters:
        c - The cursor from which to get the data.
        context - The context
        flags - Flags used to determine the behavior of the adapter; may be any combination of FLAG_AUTO_REQUERY and FLAG_REGISTER_CONTENT_OBSERVER.
    • Method Detail

      • init

        @Deprecated
        protected void init(Context context,
                           Cursor c,
                           boolean autoRequery)
        Deprecated. Don't use this, use the normal constructor. This will be removed in the future.
      • getCursor

        public Cursor getCursor()
        Returns the cursor.
        Returns:
        the cursor.
      • getCount

        public int getCount()
        Description copied from interface: Adapter
        How many items are in the data set represented by this Adapter.
        Specified by:
        getCount in interface Adapter
        Returns:
        Count of items.
        See Also:
        Adapter.getCount()
      • getItem

        public Object getItem(int position)
        Description copied from interface: Adapter
        Get the data item associated with the specified position in the data set.
        Specified by:
        getItem in interface Adapter
        Parameters:
        position - Position of the item whose data we want within the adapter's data set.
        Returns:
        The data at the specified position.
        See Also:
        Adapter.getItem(int)
      • getItemId

        public long getItemId(int position)
        Description copied from interface: Adapter
        Get the row id associated with the specified position in the list.
        Specified by:
        getItemId in interface Adapter
        Parameters:
        position - The position of the item within the adapter's data set whose row id we want.
        Returns:
        The id of the item at the specified position.
        See Also:
        Adapter.getItemId(int)
      • hasStableIds

        public boolean hasStableIds()
        Description copied from interface: Adapter
        Indicates whether the item ids are stable across changes to the underlying data.
        Specified by:
        hasStableIds in interface Adapter
        Overrides:
        hasStableIds in class BaseAdapter
        Returns:
        True if the same id always refers to the same object.
      • getView

        public View getView(int position,
                   View convertView,
                   ViewGroup parent)
        Description copied from interface: Adapter
        Get a View that displays the data at the specified position in the data set. You can either create a View manually or inflate it from an XML layout file. When the View is inflated, the parent View (GridView, ListView...) will apply default layout parameters unless you use LayoutInflater.inflate(int, android.view.ViewGroup, boolean) to specify a root view and to prevent attachment to the root.
        Specified by:
        getView in interface Adapter
        Parameters:
        position - The position of the item within the adapter's data set of the item whose view we want.
        convertView - The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view. Heterogeneous lists can specify their number of view types, so that this View is always of the right type (see Adapter.getViewTypeCount() and Adapter.getItemViewType(int)).
        parent - The parent that this view will eventually be attached to
        Returns:
        A View corresponding to the data at the specified position.
        See Also:
        Adapter.getView(int, View, ViewGroup)
      • getDropDownView

        public View getDropDownView(int position,
                           View convertView,
                           ViewGroup parent)
        Description copied from interface: SpinnerAdapter

        Get a View that displays in the drop down popup the data at the specified position in the data set.

        Specified by:
        getDropDownView in interface SpinnerAdapter
        Overrides:
        getDropDownView in class BaseAdapter
        Parameters:
        position - index of the item whose view we want.
        convertView - the old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view.
        parent - the parent that this view will eventually be attached to
        Returns:
        a View corresponding to the data at the specified position.
      • newView

        public abstract View newView(Context context,
                   Cursor cursor,
                   ViewGroup parent)
        Makes a new view to hold the data pointed to by cursor.
        Parameters:
        context - Interface to application's global information
        cursor - The cursor from which to get the data. The cursor is already moved to the correct position.
        parent - The parent to which the new view is attached to
        Returns:
        the newly created view.
      • newDropDownView

        public View newDropDownView(Context context,
                           Cursor cursor,
                           ViewGroup parent)
        Makes a new drop down view to hold the data pointed to by cursor.
        Parameters:
        context - Interface to application's global information
        cursor - The cursor from which to get the data. The cursor is already moved to the correct position.
        parent - The parent to which the new view is attached to
        Returns:
        the newly created view.
      • bindView

        public abstract void bindView(View view,
                    Context context,
                    Cursor cursor)
        Bind an existing view to the data pointed to by cursor
        Parameters:
        view - Existing view, returned earlier by newView
        context - Interface to application's global information
        cursor - The cursor from which to get the data. The cursor is already moved to the correct position.
      • changeCursor

        public void changeCursor(Cursor cursor)
        Change the underlying cursor to a new cursor. If there is an existing cursor it will be closed.
        Parameters:
        cursor - The new cursor to be used
      • swapCursor

        public Cursor swapCursor(Cursor newCursor)
        Swap in a new Cursor, returning the old Cursor. Unlike changeCursor(Cursor), the returned old Cursor is not closed.
        Parameters:
        newCursor - The new cursor to be used.
        Returns:
        Returns the previously set Cursor, or null if there wasa not one. If the given new Cursor is the same instance is the previously set Cursor, null is also returned.
      • convertToString

        public CharSequence convertToString(Cursor cursor)

        Converts the cursor into a CharSequence. Subclasses should override this method to convert their results. The default implementation returns an empty String for null values or the default String representation of the value.

        Parameters:
        cursor - the cursor to convert to a CharSequence
        Returns:
        a CharSequence representing the value
      • runQueryOnBackgroundThread

        public Cursor runQueryOnBackgroundThread(CharSequence constraint)
        Runs a query with the specified constraint. This query is requested by the filter attached to this adapter. The query is provided by a FilterQueryProvider. If no provider is specified, the current cursor is not filtered and returned. After this method returns the resulting cursor is passed to changeCursor(Cursor) and the previous cursor is closed. This method is always executed on a background thread, not on the application's main thread (or UI thread.) Contract: when constraint is null or empty, the original results, prior to any filtering, must be returned.
        Parameters:
        constraint - the constraint with which the query must be filtered
        Returns:
        a Cursor representing the results of the new query
        See Also:
        getFilter(), getFilterQueryProvider(), setFilterQueryProvider(android.widget.FilterQueryProvider)
      • getFilter

        public Filter getFilter()
        Description copied from interface: Filterable

        Returns a filter that can be used to constrain data with a filtering pattern.

        This method is usually implemented by Adapter classes.

        Specified by:
        getFilter in interface Filterable
        Returns:
        a filter used to constrain data
      • onContentChanged

        protected void onContentChanged()
        Called when the ContentObserver on the cursor receives a change notification. The default implementation provides the auto-requery logic, but may be overridden by sub classes.
        See Also:
        ContentObserver.onChange(boolean)


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 805 / . Delta: 0.04372 с