Android overlapping text on adapter - android

On some phones, mainly a Galaxy S2 I am having an issue where the results in a custom adapter overlap on each other. This is an example where user searched for the word "vaginal" in a search field, it is a medical app.
I am not sure the best way to describe this and the code is pretty convoluted at this point. The user types in a word, and database results come in showing matches. These results are in a List object and displayed via adapter.
On most phones this works as expected, with results being sequential. On at least one device, the above screenshot happens.
Is this is a known error and how can I fix it?

This looks rather like How often can you update a textview without mess , possibly caused by View reuse in the list adapter. The solution to that issue is to force the background to a fully opaque colour.

Related

How to make two ListViews scrolling up and down as one/together?

I'm a student that just get into app development using android studio "plz keep this in mind when answering my q.".
I have an assignment that requires me to use SQLite to stores and retrieves data entered by the user and then displaying it in a ListView.
The output should be as two columns one holds a pc name, the other one holds the employee's name working on that pc.
I did all that, storing and retrieving works fine, however I did use two ListViews (which appeared to be a bad choice!) to display the data (pc & employee name), so the two lists are now scrolling up/down independent from one another. Screenshot to illustrate the problem:
The two ListViews scrolling issue
I googled for a solution, one is to design a custom layout, while another suggest using lines of code to do so {I tried the custom layout but it didn't work!}. I hope someone can help me pass this assignment:(
Thanx^^
Nora.
I thinks this has been posted before, anyway the answer seems to be addressed in this link
https://arunbadole1209.wordpress.com/2011/10/03/how-to-make-simultaneous-scrollable-views-in-android/

ListView SectionIndexer's box is transparent

In my app I'm using a listview with a section indexer that displays the letter of the current selection. It's fine on a lot of devices, but when I use my app on a Galaxy Tab running Android 3.2 the letter is displayed without the little box. I don't know how to make it appear or change the color of this letter.
I tried to use android:textColorPrimary but I didn't find how to use it and I find no sample.
To see my problem, below is a screenshot. If you look carefully, the letter G is in white above the second element of the list.
This is kind of a strange answer, because I fixed it, but I'm not sure why. When I set FastScrollEnable = true later than in the contructor of my derived ListView I get this behaviour aswell. Although, my letter is almost completly off the screen.
I'll probably get downvotes for this answer, but it saved me after 6 hours of prodding around. I noticed it when I removed my prototype code from our main classes to change the FastScrollEnable from outside.

Problems with android GridView

I am trying to display 2 columns of text in a GridView in android. I create a TextView for each cell of the grid. Everything seems to work well until the TextView tries to wrap the text to a second (or more) line. When this happens, sometimes the second line of text overwrites the next cell, rather than causing the cell to expand to fit the text. All I have to do to get the text to display properly is click one of the cells in the grid. This seems to cause the grid to repaint and then everything gets displayed properly. I have tried any number of things to fix this problem but nothing seems to help.
Is there some property that I have to set on the TextView or the GridView to allow the cells to expand to fit the text? Or is this just a glitch in GridView that I have to live with?
BTW, setting android:singleLine="true" prevents the word wrap and solves the problem but it isn't an ideal solution because I really don't want the text to be truncated.
At a quick glance, I'm afraid you might have to do a work-around. I know it seems like a glitch, but it may be more ideal to continue to have your views start a consistent location instead of constantly having them shift based on content. I know this is a pain for what you're trying to do, but keep in mind that this was designed for hopefully the best solution for any application. Anyway..
One workaround I would propose might be manually updating the beginning of the views that get written over. I know it's not exactly ideal, but you can figure out where to place it based on the properties of your view. This doesn't feel like a particularly elegant solution though, so I'll try to cook something better up and/or post sample code. Good Luck!

How to show a long list without using a ListView

I am working on an exercise program, and one part is to pick an exercise, then how often you do it, with how much weight.
So, I want all this information on one screen, so going to a ListView would be annoying, I believe.
But, there may be over 100 exercises, so my current approach of using a Spinner has a problem.
It would seem that if my list is sorted, then if you can hit a key and jump to that letter then it would speed up searching for the user.
So, would it make sense to have a custom component that is basically just a dropdown list (http://msdn.microsoft.com/en-us/library/aa511458.aspx) or is there a better way to allow users to navigate a long list without going to a new screen?
You can try autocomplete widget that is described here
http://developer.android.com/resources/tutorials/views/hello-autocomplete.html

Android - Something Odd... Question

Something odd is going on, I think...
I have menu with sub-menu items.
One sub-menu gets GPS location, does some calc's and updates two display fields. No problems.
The other sub-menu takes user input and does calc's BUT, it uses the same display stuff as the fist sub-menu but, won't update the two fields with the new input for display. I have a second display just to see whats going on and this display does update the two fields correctly.
There are no differences between these displays (declarations, parameters or values) HOWEVER, and here's the lead-up to the odd thing, I got a warning when setting the display for the two fields (for displaying in the second sub-menu) and used a suggestion from the pop-up.
The suggestion was to make the TextView static. I clicked it for one (left the other as-is for trial and commented it). The warning went away but, crash! at run time.
So, here's the odd thing: Nowhere do I see anything that makes this TextView static! All related declarations and ref's to it are identical to the one I didn't make static. In fact, I tried to manually make the second one static but couldn't. I also checked the R.java file but nothing related in there...
Fortunately, I was able to use 'Undo' the Make-it-static.
Any comment/clarification for my education?
Thanks
The "Make it Static" suggestion only applies to your Java code. If you check out the declaration of your TextView it will now say something like static TextView mTextView. As for the other problem, there is no way to say for sure what is going on without seeing your code.

Categories

Resources