我正试图展示来自海底电话簿的联络人的姓名和号码,即我的DVD储存的联络人。 任何人都能够告诉我这一法典有什么错误。 请再次审判......
public class get extends Activity {
private void getColumnData(Cursor cur)
{
if(cur.moveToFirst())
{
int numi=cur.getColumnIndex(People.NUMBER);
int namei=cur.getColumnIndex(People.NAME);
String name,num;
do{
name=cur.getString(namei);
num=cur.getString(numi);
}while(cur.moveToNext());
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri u=People.CONTENT_URI;
String[] proj=new String[]{People.NAME,People.NUMBER};
Cursor cur=managedQuery(u, proj, null, null, null);
getColumnData(cur);
TextView tv=new TextView(this);
tv.setText("First step");
setContentView(tv);
}
}