The id that is generated in the R class comes from a layout xml file... For example, in one of my programs I have a Gallery View that displays icons for currently running programs.. I have an xml file under /res/layout that contains the following:
<Gallery android:id="@+id/running_tasks_gallery" /> I then reference that particular view with: R.id.running_tasks_gallery Of course, this example is overly simplified and my actual Gallery tag contains much more than just the id... but the important elements are there. BTW... all this information is found in the Dev Guide. On Aug 27, 4:41 pm, ConquerWorm <[email protected]> wrote: > Hey, > > I am wondering if someone can explain this file to me and how it > works. See I have created a very simple project that is suppose to > draw a Background image to the screen. I have created two files, > FirstTryActivity and FirstTryView. > > So Here is the line of code that is causing me problems: > > mFirstTryView = (FirstTryView)findViewById(R.id.FirstTryView); > > R.id.FirstTryView doesn't exist. R didnt create and id for my > FirstTryView and so I am wondering how I can get it to create it. Is > there a line of code that creates it that I am missing or did I add a > file to the project wrong? > > I found that with images you just need the image to be in the drawable > folder and it adds it, do I need something similar for my code files? > > Thanks for your Help > CW --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

