If you remember tasky demos from xamarin samples, we can connect the Tasks ( like id, title, sub) with
TableView.Source = new RootTableSource(tasks.ToArray ());
In monodroid, its bit complicated. I do use sqlite and here my monotouch sqlite code
{
sqlCom.CommandText="SELECT * FROM Personel";
using (SqliteDataReader dbReader = sqlCom.ExecuteReader ())
{
if (dbReader.HasRows)
{
int i;
// Advance through each row
tasks = new List<TaskX> ();
while (dbReader.Read ())
{
TaskX dtask= new TaskX() {Id = Convert.ToInt16( dbReader["ID"]),
Name = String.Format (Convert.ToString (dbReader["UserName"])),
Notes=String.Format ( Convert.ToString (dbReader["Password"])),
Done=false};
tasks.Add(dtask);
};
}
};
TableView.Source = new RootTableSource(tasks.ToArray ());
}
and i noticed the code lines takes the source values
protected override void OnResume ()
{
base.OnResume ();
this._tasks = Tasky.BL.Managers.TaskManager.GetTasks();
// create our adapter
this._taskList = new Adapters.TaskListAdapter(this, this._tasks);
//Hook up our adapter to our ListView
this._taskListView.Adapter = this._taskList;
}
is any way to show sqlite values like id, username on android list view? thanks