Android Question Text Field Not Always Showing In Custom List View

Big Dave

Member
Licensed User
Longtime User
I have a clv which displays a list of two fields. A number and a text field, the data being obtained from a SQLite database. For some reason every so often when I load the list it does not show the last visible text field although the number is shown. Sometimes the text field in a couple of other entries further up the list does not display either but a less frequent event. I have displayed the data in the log file to ensure it is present. At the moment I have only tested in debug mode on a Samsung Galaxy S9+ so not sure if this is something specific to this combination. Any thoughts and pointers most welcome. Thanks.
 

QtechLab

Active Member
Licensed User
Longtime User
I have a clv which displays a list of two fields. A number and a text field, the data being obtained from a SQLite database. For some reason every so often when I load the list it does not show the last visible text field although the number is shown. Sometimes the text field in a couple of other entries further up the list does not display either but a less frequent event. I have displayed the data in the log file to ensure it is present. At the moment I have only tested in debug mode on a Samsung Galaxy S9+ so not sure if this is something specific to this combination. Any thoughts and pointers most welcome. Thanks.
Hi,

i don’t know if is this the case but i had a similar issue with clv and labels that were not updating the values.

I used to insert in clv many b4x views (made with designer). The B4X page had a label on top called LbTitle, each clv item (the b4xview) had also a label called LbTitle.
Sometimes the labels in the clv did not receive any value update. When i changed the label name in LbTitleItem it start working with no issues.

I don’t know if this is just luck but it worked for me
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
Hi,

i don’t know if is this the case but i had a similar issue with clv and labels that were not updating the values.

I used to insert in clv many b4x views (made with designer). The B4X page had a label on top called LbTitle, each clv item (the b4xview) had also a label called LbTitle.
Sometimes the labels in the clv did not receive any value update. When i changed the label name in LbTitleItem it start working with no issues.

I don’t know if this is just luck but it worked for me
Hi

Thanks for the input. I have checked all my field names and they are unique so don't think that is the answer. I have added the project in an additional post with some info on how I get to the problem. Again, thanks for the input.
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
Attached is the code for my little project. The issue relates to module was30 which is the "Availability Codes" menu option. Once there the last visible entry may or may not contain a text value. I found that if you keep exiting, via the red arrow, and going back in you eventually get the problem to occur. So something of a random event. Hope this helps anyone interested to have a look. Thanks in advance.
 

Attachments

  • WorkAvailabilitySystem.zip
    380.4 KB · Views: 146
Upvote 0

Mahares

Expert
Licensed User
Longtime User
the code for my little project.
This is a huge project. I wonder what it would be like if you called it big instead of little. At any rate, I took a look and ran WAS30 at least 20 consecutive times and exited via its red arrow and it worked every time. the last few records always have the number and the text. 41 A41, 42, A42, 51 Holiday, 99 Not Available. The only thing I recommend is to close the resultset every time which you are missing: WACodesSet.close .
If that does not solve your problem, I hope someone more qualified will discover the problem you encountered.
 
Last edited:
Upvote 0

Big Dave

Member
Licensed User
Longtime User
This is a huge project. I wonder what it would be like if you called it big instead of little. At any rate, I took a look and ran WAS30 at least 20 consecutive times and exited via its red arrow and it worked every time. the last few records always have the number and the text. 41 A41, 42, A42, 51 Holiday, 99 Not Available. The only thing I recommend is to close the resultset every time which you are missing: WACodesSet.close .
If that does not solve your problem, I hope someone more qualified will discover the problem you encountered.
In the past I have written large computer applications for major companies so an app like this is small to me. Given I am self taught in B4A there is an element of duplication in the code so it is larger than it could be! Anyway thank you for your input, I will add the close statement and see if it resolves the problem. Thank you.
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
This is a huge project. I wonder what it would be like if you called it big instead of little. At any rate, I took a look and ran WAS30 at least 20 consecutive times and exited via its red arrow and it worked every time. the last few records always have the number and the text. 41 A41, 42, A42, 51 Holiday, 99 Not Available. The only thing I recommend is to close the resultset every time which you are missing: WACodesSet.close .
If that does not solve your problem, I hope someone more qualified will discover the problem you encountered.
Unfortunately adding the close on the resultset did not resolve the problem. Additionally the same problem sometimes occurs on two other entries, (codes 2 and 21) the code number is displayed but the text is not. I shall continue to investigate and try different things. If I find a solution I will post it. Again thank you.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Unfortunately adding the close on the resultset did not resolve the problem
How many consecutive times did you run it. I did not have any problems with your project the way it was, posted even before I put the resultset.Close. The suggestion for the resultset was just a customary thing to do. You may want to add a sleep(x) before you display the data in the xClv just after you clear the customlistview. It wouldn't hurt to anchor your xClv top and bottom. Jose maybe testing it too. I don't know what he discovered
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
How many consecutive times did you run it. I did not have any problems with your project the way it was, posted even before I put the resultset.Close. The suggestion for the resultset was just a customary thing to do. You may want to add a sleep(x) before you display the data in the xClv just after you clear the customlistview. It wouldn't hurt to anchor your xClv top and bottom. Jose maybe testing it too. I don't know what he discovered
Just to clarify I do not exit the app. I select "Availability Codes" which runs WAS30. Sometimes code 41 text is not displayed and less frequently code 2 text and code 21 text is not displayed, both of them but code 41 text is. If the list is shown I select the red exit arrow and then immediately select "Availability Codes" again. I repeat this back and forth a few times until the text is missing from usually code 41. I usually get the problem within 5 or 6 attempts.
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
Can you post a screenshot to see the elements you're not seeing?
Screenshot_20211213-160113[1].jpg
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Just to clarify I do not exit the app.
I do not exit the app either. I click the red arrow and click the button 'Availability Codes' again. I am doing it the way you do it. Even after 20 times all text is shown. Here is a snapshot after 20 times.
 

Attachments

  • BigDave.png
    BigDave.png
    80.9 KB · Views: 126
Upvote 0

josejad

Expert
Licensed User
Longtime User
I do not exit the app either. I click the red arrow and click the button 'Availability Codes' again. I am doing it the way you do it. Even after 20 times all text is shown
Same behaviour, tested on emulator and in my Samsung A10 with no problems.
The only issue, in my Samsung A10 the layouts doesn't fit the screen.

1.jpeg2.jpeg
 
Upvote 0

Big Dave

Member
Licensed User
Longtime User
Can you post a screenshot to see the elements you're not seeing

I do not exit the app either. I click the red arrow and click the button 'Availability Codes' again. I am doing it the way you do it. Even after 20 times all text is shown. Here is a snapshot after 20 times.
Can you advise if you run in debug or release mode. I am going to add a sleep, run in release mode and also try it on another phone to see if the problem goes away. Thank you for trying.
 
Upvote 0
Top