Since you have exactly two images, face down and face up, you might
try out an ImageSwitcher object.  Toggle the image with show next and
skip the validation business.

On Jan 13, 7:00 am, Gregg Reno <gregg.r...@gmail.com> wrote:
> I am working on a card game, and using a custom ImageView for the
> cards.  I have an OnClickListener that handles the presses on the
> cards.
>
> What I want to happen is in some cases is:
> - User presses a face down card
> - Card displays face up
> - Wait 1 second
> - Card displays face down
>
> Within the OnClickListener , I draw the face up card, call invalidate,
> use Thread.currentThread().sleep(1000), draw the card face down, and
> call invalidate again.  What happens is you never see the card face up
> - just face down.
>
> From what I understand from prior threads, this is expected behavior
> as invalidate won't re-draw immediately, so you only wind up seeing
> that last thing drawn. The view is probably being re-drawn after
> exiting the OnClickListener.
>
> So, any suggestions for accomplishing this using a different method?
>
> Thanks,
> -Gregg
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to