ZoobTheSimian wrote: > > I've moved all the logic about whether the card should stay face-up or > flip over again into a separate function, called in a new thread. > Brilliant. Almost works great (the card shows its face), but it > doesn't quite. For some reason, it's failing on the line > > ((ImageView) gridview.getChildAt(mIntFirstCardID)).setImageResource > (R.drawable.cardback); > > I've done some debug, and it's finding the gridview object fine, it's > finding the child imageview fine, it's finding the drawable ID fine, > but it's still bugging out with "...has stopped unexpectedly". > > Any ideas? Is there some weird property on setImageResource which > means I can't call it outside the main thread?
It's not a weird property -- anything you do that alters the UI has to be done on the UI thread. Consider using AsyncTask and putting the setImageResource() call in onPostExecute(), or use any of the other "please run this on the UI thread" techniques (View#post, Activity#runOnUiThread, Handler). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Looking for Android opportunities? http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

