The Database is not working well, you have to check it.
I propose these changes :
1. Add a panel named editpanel, instead of the edit activity -
editpanel.Initialize("")
Activity.AddView(editpanel,0,0,100%x,100%y)
editpanel.Color = Colors.ARGB(255,255,255,255)
editpanel.LoadLayout("Edit.bal")
editpanel.Visible = False
2. populate the list by single lines with the two parameters, like this for example:
ListView1.AddSingleLine("MPG= " & answerMPG & ", Cost= " & answerCost)
3. Get the data directly from the listview:
Sub ListView1_ItemClick(Position As Int, Value As Object)
editpanel.Visible = True
Dim str() As String = Regex.Split(",",ListView1.GetItem(Position))
edtMiles.Text = str(0).Replace("MPG= ","")
edtPounds.Text = str(1).Replace(" Cost= ","")
End Sub
4. To go back from edit to main, add
Sub btnExit_Click
editpanel.Visible = False
End Sub
With these you'll be able to see the data in the edittexts and continue to update the DB (after you fix it).
I suspect this line query = "INSERT INTO fuelcost VALUES (NULL, ?, ?)" where the NULL is killing the ID, but I'm not sure.