Android Question Listview click

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hi, I've got a couple of edit text boxes I'm populating from a listview.

I'm checking if the edit text boxes are null, then popping in the value from the listview, but both are popping in on one click (from one position).

I'd prefer to populate each edit text box per click (at the current listview position)

Any suggestions?
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
ok, here's my code.

B4X:
'pop into player 1
If ListView62.Size > 0 AND EditText61.Text ="" Then
  EditText61.text =  ListView62.GetItem(Position)
  ListView62.RemoveAt(Position)
End If

'pop into player 2
If ListView62.Size > 0 AND EditText62.Text ="" Then
  EditText62.text = ListView62.GetItem(Position)
  ListView62.RemoveAt(Position)
End If
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
That's not enough information, but, you could add a RETURN TRUE inside that If...Then, e.g.
B4X:
'pop into player 1
If ListView62.Size > 0 AND EditText61.Text = "" Then
 
   EditText61.text = ListView62.GetItem(Position)
   ListView62.RemoveAt(Position)
 
   Return True
 
End If
 
Upvote 0

merlin2049er

Well-Known Member
Licensed User
Longtime User
Ok, what I was expecting to happen is:

One click on an individual inside that listview would populate the first available edittext.text spot, the next click within that same list (on another individual) would populate the next edittext.text spot.


What is happening now, is after clicking one individual, it's populating both edittext.text spots.

Would "Return True" fix that?
 
Upvote 0
Top