码迷,mamicode.com
首页 > 其他好文 > 详细

SimpleCursorAdapter(Context, int, Cursor, String[], int[]) is deprecated???

时间:2014-06-17 12:58:51      阅读:472      评论:0      收藏:0      [点我收藏+]

标签:android   style   class   blog   code   java   

    ListAdapter bookAdapter = new SimpleCursorAdapter(this,R.layout.booklist,cursor,from,to);

提示:The constructor SimpleCursorAdapter(Context, int, Cursor, String[], int[]) is deprecated

 

API 16给出的解析:
@Deprecated
public SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) 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 the enables auto-requery.

public SimpleCursorAdapter(Context context,
                   int layout,
                   Cursor c,
                   String[] from,
                   int[] to,
                   int flags)
Standard constructor.
Parameters:
context - The context where the ListView associated with this SimpleListItemFactory is running
layout - resource identifier of a layout file that defines the views for this list item. The layout file should include at least those named views defined in "to"
c - The database cursor. Can be null if the cursor is not available yet.
from - A list of column names representing the data to bind to the UI. Can be null if the cursor is not available yet.
to - The views that should display column in the "from" parameter. These should all be TextViews. The first N views in this list are given the values of the first N columns in the from parameter. Can be null if the cursor is not available yet.
flags - Flags used to determine the behavior of the adapter, as per CursorAdapter.CursorAdapter(Context, Cursor, int).

 

 

SimpleCursorAdapter(Context, int, Cursor, String[], int[]) is deprecated???,布布扣,bubuko.com

SimpleCursorAdapter(Context, int, Cursor, String[], int[]) is deprecated???

标签:android   style   class   blog   code   java   

原文地址:http://www.cnblogs.com/lyyh-victory/p/3791743.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!