Android Question Error - Bug or I have no idea. Help.

Enxix

Member
Hola a todos.
Me pasa algo en este simple código
Tengo dos paginas.
En una pagina, hay un botón y un listview.
En la segunda pagina, un solo botón.

Cuando doy click en el botón de la segunda pagina llama a un método publico de la primera pagina para que cargue datos en el listview.
(accedo a la segunda pagina desde el botón de la primera)
Acá donde pasa lo raro.. El listview no muestra la información. Pero si toco el listview aparece todo de repente. Obviamente no quiero eso, quiero que aparezca la información cuando cierro la segunda pagina.

Adjunto ejemplo.
Gracias de antemano.




Hello everyone.
Something's happening with this simple code.
I have two pages.
On one page, there's a button and a listview.
On the second page, there's only one button.

When I click the button on the second page, it calls a public method on the first page to load data into the listview.
(I access the second page from the button on the first)
Here's where the weird thing happens... The listview doesn't display the information. But if I tap the listview, everything suddenly appears. Obviously, I don't want that; I want the information to appear when I close the second page.

I've attached an example.
Thanks in advance.
 

Attachments

  • PListView.zip
    14 KB · Views: 11

Erel

B4X founder
Staff member
Licensed User
Longtime User
I see it too. Looks like some optimization related to ListView. It will work with this code:
B4X:
Public Sub Precargar
    For i = 0 To 9
        ListView1.AddTwoLinesAndBitmap("Prueba1","pppooopppoooppp",LoadBitmap(File.DirAssets,"password-100.png"))
    Next
    ListView1.Left = 20dip
End Sub

I highly recommend you to use CustomListView. ListView shouldn't be used at all.
 
Upvote 0

Enxix

Member
I see it too. Looks like some optimization related to ListView. It will work with this code:
B4X:
Public Sub Precargar
    For i = 0 To 9
        ListView1.AddTwoLinesAndBitmap("Prueba1","pppooopppoooppp",LoadBitmap(File.DirAssets,"password-100.png"))
    Next
    ListView1.Left = 20dip
End Sub

I highly recommend you to use CustomListView. ListView shouldn't be used at all.

Hola Erel. perfecto.
tambien funciona con "requestfocus".
pero tienes razon voy a usar customlistview

Hi Erel. Perfect. It also works with "requestfocus". But you're right. I'm going to use customlistview.
 
Upvote 0
Top