我有一个应用程序,我在List<CustomerInfo>
中获取数据我想在列表视图中显示这些数据。我该怎么做。目前我能够在LogCat中显示数据。但我不知道怎样才能继续在listview中显示数据。
List<CustomerInfo> customerInfo;
// Database Handler declarations
db = new DatabaseHandler(this, DATABASE_NAME, null, DATABASE_VERSION);
checkDbExists = checkDataBase();
if(checkDbExists){
Toast.makeText(getApplicationContext(), "Table exists", Toast.LENGTH_SHORT).show();
customerInfo = db.getInfoForSelectedCategory(strCategoryName);
for (CustomerInfo ccinf : customerInfo) {
String log = "Id: " + ccinf.getID() + " ,Name: "
+ ccinf.getName() + " ,Category: "
+ ccinf.getCategory() + " ,Email: " + ccinf.getEmail()
+ " ,Contact: " + ccinf.getContact() + " ,Address: "
+ ccinf.getAddress();
Log.d("Record: ", log);
}