I am new as new, but from what I got:
"this" is context. It is "this" in all examples I saw. What is in
parenthesis you will see if you highlight createFromResource in
eclipse. R.array.planets is a string array. It can be created like:

       final String[] branches= new String[] {
                "Brno", "Černý Most", "Zličín"
              };
and then placed in: ...ArrayAdapter.createFromResource(this,
branches, ...
Last is layout, which you are calling, this one is generic from
google. You can create your own in res/layout folder and summon there:
..R.layout.row);
(in case file is named row.xml).
Nice tutorial about layouts is http://commonsware.com/Android/excerpt.pdf

Adam

On Sep 20, 9:00 am, Jeffrey <jeffisagen...@gmail.com> wrote:
> I'm kind of at a loss of how to achieve this probably simple task. How
> do I get the contents of a variable (say and int variable) to display
> on the screen? I've collected that I have to use an adapter, but I
> can't find a simple explanation of how to use them.
>
> In one of the tutorials, they list this code:
>
> ArrayAdapter adapter = ArrayAdapter.createFromResource(
>             this, R.array.planets,
> android.R.layout.simple_spinner_item);
>     adapter.setDropDownViewResource
> (android.R.layout.simple_spinner_dropdown_item);
>     s.setAdapter(adapter);
>
> Problem is that I have no idea what a few things mean (like the use of
> "this" and what items need to get in the parenthesis after
> ArrayAdapter.createFromResource. If someone could refer me to a post
> describing adapters and how to use them that would be great.
>
> Also as a side question, if I need to transfer data from one view to
> another, do I need to pass it using intents? And if so, how to I send/
> read them?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to