Closed ahmetkucuk closed 9 years ago
I'm having the same problem on Android Wear.
Same thing on Galaxy S2 with 4.0.3. More accurately, the text is invisible. Using a color or a selector doesn't change anything.
when the text becomes invisible, I see this in the logCat:
E/libEGL: call to OpenGL ES API with no current context (Logged once per thread)
W/HardwareRenderer: EGL error EGL_BAD_SURFACE
W/HardwareRenderer: Mountain View, we've had a problem here, Switching back to software rendering
I think the disabling of hardware acceleration is related to the problem, as in my manifest I tried adding:
<activity
android:hardwareAccelerated="false"
...
</activity>
and can observe this problem to happen immediately.
@phileo Thanks for additional informations, i'll try to look into it as soon as possible.
could this be related: https://code.google.com/p/android/issues/detail?id=37956 If so, which one of the 3 workarounds described would be most appropriate ?
found the problem! Or at least a problem which affected my project, not 100% if this is the same problem.
In my case, the listener that I registered with mOnItemSelected was doing many things, and it seems some of those things are interfering with the OpenGL thread in canvas.draw(). So, instead of calling mOnItemSelected.onItemSelected() directly, I posted it to the UI Thread. This appears to fix the invisibility issue in my case.
If you want, I can submit a pull request.
@phileo Thanks for digging into this issue. Pull request would be appreciated.
HorizontalPicker is not visible in the screen however when i touched the screen where HorizontalPicker suppose to be onItemClicked and onItemSelected methods are called. When i run it on Android L (Nexus 4) it is visible.