我知道我可以使用 Cursor c=managedQuery(Contacts.CONTENT_URI,null,null,null,Contacts.DISPLAY_NAME+" ASC") 来获取游标。
现在我希望从 myMRuleList 中得到一个 Cursor,我该怎么做?谢谢!
lv = getListView();
Cursor c=managedQuery(Contacts.CONTENT_URI,null,null,null,Contacts.DISPLAY_NAME+" ASC");
String[] cols=new String[] {Contacts.DISPLAY_NAME};
int[] views=new int[]{android.R.id.text1};
SimpleCursorAdapter myAdapter=new SimpleCursorAdapter(this,android.R.layout.simple_list_item_1,c,cols,views);
this.setListAdapter(myAdapter);
List<MRule> myMRuleList=new ArrayList<MRule>;
MRule aMRule=new MRule();
aMRule.ruleID=1;
aMRule.name="a";
aMRule.enabled=false;
MRule bMRule=new MRule();
bMRule.ruleID=1;
bMRule.name="b";
bMRule.enabled=false;
myMRuleList.add(aMRule);
myMRuleList.add(bMRule);
public class MRule {
public int ruleID;
public String name;
public Boolean enabled;
}