> That is because there is a very good chance that there are better ways > of solving your problem. Until you tell us what it is you are trying to > do at a high level, we cannot readily advise you on better solutions.
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. I found a way to get it to work but I have to set up the UI programmatically, since if I don't know how to make the XML file change dynamically depending on how many dice it will need to draw, or which die images to draw. 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. I know that the layout I'm trying to accomplish will work, as I can make it in XML, though it wouldn't actually populate dynamically. I'm stuck trying to figure out why trying to place 2 child view into a single view id causing an error. I could get around this if I could find an example of making XML populate them dynamically, but I haven't been able to find anything on that. In fact, the only question I've had so far that I found a good example for was making a button click. Other than that all I've done has been finding vaguely similar examples and discovering what I need to change to suit my needs through trial and error. So I guess this question might be easier to answer: How can I make a TableLayout populate ImageViews Dynamically? Right now I only know how to do it through .setImageResource then .addView(). 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. I know what I'm trying to do can't be that difficult, I'm sure I'm just missing something in the addView() code for the extra child views, but I can't for the life of me find out what I need to add to make this simple concept work. It is very frustrating. On Sep 27, 4:06 am, Mark Murphy <mmur...@commonsware.com> wrote: > Jeffrey wrote: > > Unfortunately that doesn't really help. I have no idea what I'm > > looking for in the logcat. Likewise I don't what the stacktrace is or > > how to find it in the logcat. > > If you are new to Java development, I really recommend learning the > basics of Java outside of Android first, before tackling Android. > > A Java stack trace will look something like this: > > java.io.FileNotFoundException: fred.txt > at java.io.FileInputStream.<init>(FileInputStream.java) > at java.io.FileInputStream.<init>(FileInputStream.java) > at ExTest.readMyFile(ExTest.java:19) > at ExTest.main(ExTest.java:7) > > (fromhttp://www.devdaily.com/java/edu/pj/pj010009/) > > Usually, with Android, there will be two of them back-to-back, with the > second one prefixed by "Caused by:". That one will indicate where things > are going wrong (e.g., NullPointerException). > > > I can't find any > > information on how to programmatically create a UI with multiple child > > views inside a single viewgroup. > > That is because there is a very good chance that there are better ways > of solving your problem. Until you tell us what it is you are trying to > do at a high level, we cannot readily advise you on better solutions. > > -- > 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 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 -~----------~----~----~----~------~----~------~--~---