1. Check out our companion app, Forums for Android! Download from Google Play

Problem with onItemClickListener

Discussion in 'Application Development' started by mojazu, May 30, 2010.

  1. mojazu

    mojazu New Member
    Thread Starter
    5

    May 30, 2010
    1
    0
    5
    Hi people. I'm new to android and I'm getting some troubles, especially with listeners or threads.

    Right now I'm making a memory game for doing pairs. The cards are ImageViews within a GridView.

    I'm doing all the logic (of comparing card values, if it's the first or second selected card and all that stuff) inside of the onItemClickListener of that GridView.

    When the user selects the second card, both cards selected should flip down again or disappear. Well, the logic works fine, but the process is so fast that the user can't view which was the second card. So I introduced a little delay, but I discovered that the screen won't get refreshed while the OnItemClick method is running, so the user will never know which was the second card.

    Am I explaining myself? Any idea? Some friend told me I could resolve this with the use of threads, but I don't have any idea.

    Thanks in advance. :)
     

    Advertisement

Share This Page

Loading...