I have a list view with some complex layouts.
Some parts of the layouts are set visible/adjusted at runtime (i.e. not everything set by the xml).
It has caught my attention than in some "rare" cases there is a specific part (the same in all cases) that is rendered visually either a few seconds after looking at the list item or if I scroll down the list and then scoll back up again.
What I observe is that it seems like after a few seconds the list item is "redrawn" and the item suddenly appears.
I have added debug output to check for its visibility and according to the console log, the item is visible when the getView is called for that the first time.
So I have no idea what the issue might be.
How can I debug issues like this?
There is an option in the developer pane on your cellphone that flash every time a piece of screen change.
You can also use something like this https://github.com/JakeWharton/scalpel
If you are using an android device you can activate 'developer options' (you'll have to google how to do this for your device as it varies) like Luca said. These are really cool because you can see where changes appear on the screen and add layout borders etc which make it easier to see exactly what is happening. They can be really useful for debugging sometimes!
I had a similar problem and I tried removing most of my code and adding chunks back in to make sure they were working and eventually you should be able to locate at least the general area where the problem is.
Good luck! Sometimes these things can take a while!
Related
When I rotate the screen on a tablet, my widget's list view disappears and the buttons become unclickable. I'm not sure what happening with the most recent remote view to cause this. Any suggestions?
Here is my onUpdate function
onUpdate
Since we do not have the full code, it's kind of hard to give an actual answer to your problem.
However, I might have an idea & the cause of your problem could be in your .XML file. The same way your app looks great in a certain rotation, most surely on the one you originally designed your work on, it is very possible that it might result in problems when you changed the rotation.
However, it all depends of the layouts you are using & how they are used. I would advise to share your entire code so we can go through it.
Another day, another bug...
I have three AutoCompleteTextFields with the filter overrided to get completion from my REST service, but my big problem is that the suggestions popups of those text are clickthrough... so when I've already completed one of them, any click on the suggestion popup of another will trigger the underlying ACTF, which is already filled and so show it's own popup, making impossible to select the item from the other ACTF suggestion popup.
The two screenshots here show the situation, the ACTF are the textfield hinted "Partenaire", "Contact..." and the already autocompleted one under.
On the second screenshot, I've tried to select the item over the third ACTF, and so the four first results are from the third ACTF, and the four last are from the "Partenaire" ACTF.
Is there a way to override something like onShow() for the popup and it's hiding equivalent, so I could disable the other ACTF when I type in one of them ?
I think it's a good way to solve the problem, but I am open to any other idea :)
I've forget to mention it, but the problem occur on Android and on the simulator, but iOS has not such problem.
Check that your UI has scrolling set correctly, only one container in the hierarchy can be scrollable on the Y axis. By default the Form's content pane should be scrollable on Y (unless it's a border layout).
Background
There are some nice apps out there that show some layout on top , while the user is making a call or answering one (like "current caller id").
I need to create an app with the ability to show something on top , during a call, and allow it to be interactive.
The problem
Using broadcastReceiver ,foreground service and SYSTEM_ALERT permission, I've succeeded showing something on the screen during calls.
As long as the content being shown is static, I have no problems.
However, I've noticed that when I try to make the content being shown to be interactive , I face some problems:
Everything is jumpy and this includes not only animations, but also setting visibility to visible/gone. I hate to think how it would work like when I need to make things draggable.
Not sure if this is the reason, but using the SlidingDrawer make the entire width belong to the SlidingDrawer and you cannot click through it. This means that if its location is at the bottom, you can't touch the "answer" button when someone calls you.
The question
What is the reason for those problems?
How can I fix them and be able to show things right?
How do other apps handle it right ?
EDIT: about the SlidingDrawer , it seems that it has terrible bugs about its location and size, and the content area, even when it's not shown to the user and the user can see through, it cannot be touched through. Still, I don't know why, and how to fix it, and I also don't know why things are so jumpy compared to normal apps (probably because of over-drawing, but it's really really slow).
Maybe this question should be more general: how to make a floating window like on AirCalc, that can be moved easily yet still be quite fast.
For the dragging functionality, I've tried to get the layoutParams of the root view (which is of type WindowManager.LayoutParams ) that I show, update it and set it again, but for some reason it didn't do anything. Wonder what I'm doing wrong.
EDIT: it seems that i should be using windowManager.updateViewLayout for updating the layoutParams. Using this post , I've made it perfectly draggable.
Ok, I've come up to some conclusions about this, first to answer my original questions:
it's probably because of overdraw and the views i've used. I wanted to try out libraries that could replace the slidingDrawer , but each had a different problem. using simple views proved that the idea in general works.
in the case of visibility changes, it was jumpy because the size of the view wasn't able to fit using the current WindowManager.LayoutParams size.
slidingDrawaer does have issues since it uses the whole size it get when closed or opened.
now to the rest of the issues :
unable to drag ? instead of the regular setLayoutParams , use windowManager.updateViewLayout .
unable to touch outside of the view ? set its minimal size according to your needs. you can also set the window flags so that touch event would go through .
want to listen to calls events ? you can use the broadcastReceiver for triggering the showing of the app, but I suspect that hanging the call might cause the intent be received later sometimes. I think you can use telephonyManager and listen to events there, using the service you run in the foreground (that i've created just to make sure the app won't close in the middle).
if anyone else has questions, i can help.
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.
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.