Jeffrey wrote: > Fair Enough, I need a page that displays random dice. I have tried to > use an adapter to bind the random dice to a GridView, but that didn't > work as every time the dice scrolled off the screen and came back they > were being re-drawn and the result would change.
That should be solvable: consider your data model to be the rolled results. Here is how I would implement this, knowing nothing about your underlying code: Step #1: Create a DiceRoll class that holds the numerical result of whatever dice you are rolling. Step #2: When you want to display a set of rolls, build up an ArrayList<DiceRoll> containing the results of those rolls. Step #3: Create a DiceRollAdapter, inheriting from ArrayAdapter, that knows how to update ImageViews (or whatever) to show the values for a particular DiceRoll. Then, when the user scrolls around and back again, your dice should retain their existing values. Here is a free sample chapter from one of my books that goes through some of this process, albeit not with dice and rolls: http://commonsware.com/Android/excerpt.pdf > I > have it working right now but they won't display in a grid because you > have to use an adapter and I haven't found a way to use an adapter and > get away with said problem of changing values. See above. Dynamically building a layout, as you are trying to do, will get seriously painful when you have to start dealing with landscape/portrait, QVGA/HVGA/WVGA, and so on. Use an XML layout for the activity and an XML layout for each grid cell (or ListView row or whatever sort of selection widget you settle upon), and things will go much more smoothly. > Also as a side note the logcat I was looking at for the crash didn't > have anything like what you posted above. It didn't even have any > thing that vaguely resembled an error. If you have an unhandled exception, logcat will always contain the stack trace. If you handle the exception yourself in a try/catch block, add something like this to the catch(Exception e): android.util.Log.e("MyAppNameHere", "Something about the exception", e); That will dump the stack trace, along with your message, to logcat. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Beginning Android_ from Apress Now Available! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

