首页 新闻 会员 周边

android CursorLoader使用方法

0
悬赏园豆:30 [待解决问题]

SimpleCursorAdapter的构造方法过期了,怎么用CursorLoader替代啊

我的代码如下

public class MainActivity extends Activity {    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //...
    }
    public void btnShowByCursorAdapter(View v) {
        Cursor c = service.getScrollCursor(0, 20);
        SimpleCursorAdapter sa = new SimpleCursorAdapter(this, R.layout.item, c, 
                new String[]{"name","sex","phone","email"}, new int[]{R.id.name,R.id.sex,R.id.phone,R.id.email});
        listViewShowItem.setAdapter(sa);
    }    
    public void btnShowBySimpleAdapter(View v) {
        //...
    }    
    //....还有很多方法
}

最好新建一个类,然后在这个方法内部使用。请问怎么做 -。-

iFinVer的主页 iFinVer | 初学一级 | 园豆:181
提问于:2014-11-02 11:42
< >
分享
所有回答(1)
0

SimpleCursorAdapter 有2个构造方法,另一个没过期 0.0

iFinVer | 园豆:181 (初学一级) | 2014-11-02 16:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册