2
我做的功能,去了線光標這些線路,並試圖添加到數組,得到一個自定義的錯誤陳述arr_date[i]=String.valueOf(str);
錯誤的功能
private String[] logCursor(Cursor c) {
// TODO Auto-generated method stub
final String Tag="States";
String[] arr_date = new String[] {};
if (c!=null) {
if (c.moveToFirst()) {
String str;
int i=-1;
do {
str="";
i=i+1;
for (String cn: c.getColumnNames()) {
str = str.concat(c.getString(c.getColumnIndex(cn)));
}
Log.d(Tag, str);
arr_date[i]=String.valueOf(str);
} while (c.moveToNext());
}
}
return arr_date;
}
是我的答案是否足夠? – Premsuraj 2013-03-12 09:01:43