How Can I Stop an Android SlidingDrawer from Flickering when TextView repaints
I have an Android activity that includes some TextViews and a SlidingDrawer. The sliding drawer animates smoothly as long as nothing calls setText on the TextViews. This is a dealbreaker for me, because in my activity, a runnable causes setText to be called several times per second, causing some pretty nasty flicker while I am Sliding the SlidingDrawer open.
Any ideas on how to stop this flickering and still have my TextViews update the way they should?
Here is the code that is causing the flicker, specifically the two setText lines below, called in my Activity.OnCreate() meth开发者_JS百科od.
mMainUIHandler = new Handler() {
public void handleMessage(Message msg) {
String[] positions = msg.obj;
xCoords.setText(positions[0]);
yCoords.setText(positions[1]);
}
}
Update: I haven't been able to solve this yet, but I have worked around it. I stop the updates while the SlidingDrawer.isMoving(). This works for now, but doesn't answer the question.
精彩评论