When using android:id in the xml this will be compiled into the R class and
you will have access to it via R.id.<name>
So:
<ListView android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
When compiled will give:
R.id.list
in java.
>From ( http://code.google.com/android/intro/tutorial-ex1.html ):
Resources and the R class
The folders under res/ in the Eclipse project are for resources. There
is aspecific
structure <http://code.google.com/android/kb/commontasks.html#filelist> to
the folders and files under res/.
Resources defined in these folders and files will have corresponding entries
in the R class allowing them to be easily accessed and used from your
application. The R class is automatically generated using the contents of
the res/ folder by the eclipse plugin (or by aapt if you use the command
line tools). Furthermore, they will be bundled and deployed for you as part
of the application.
On Wed, Dec 31, 2008 at 4:28 AM, Fender <[email protected]> wrote:
>
> OK, so im starting to get the hang of things with android. XML wise, i
> get it. Its the java side that im currently struggling with. For a
> test app, im trying to do something very simple.
>
> Create a field and a radio box with a value (an empty field, then a
> radio group with like 1, 2, 3, 4, etc.). That i can do.
>
> Now, i want my app to be able to define the inputs as variables. AKA
> Whatever is put into the field is stored as fieldvariable, then
> whatever number is selected is stored as selectednumber or something,
> then i want to be able to do some basic math with it, and display the
> answer. For example, i type 4 in the field, i select 1 from the radio
> group, then hit a button that says calculate, and the answer is
> displayed.
>
> XML wise, i get it. I can create a field for numbers only, i can
> create the radiobox no problem, its the java side i dont get. Would
> someone be kind enough to show me what java id have to use, and break
> down the different parts for me? Id GREATLY appreciate it.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---