On Fri, Jul 8, 2011 at 12:34 PM, Raúl Do Santos <[email protected]>wrote:

> Exactly but the issue is that my app strictly must declare the UI only in
> javacode, then the problem is that I can not access the elements created
> dynamically by their id, if i do: LinearLayout ll =
> findViewById(R.id.layoutSpinner); ll is null.
>

Sure you can.

LinearLayout ll = new LinearLayout(this);
ll.setId(42);
setContentView(ll);
findViewById(42); <- Should return LL

Untested, but I do dynamically generated IDs for RadioButtons and it
definitely work.

Try something simple like that first, forgetting about the ArrayList for a
second, and see if it works. I suspect you're confusing variables and trying
use the same values for multiple things, leading to the issues you're
running into.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
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

Reply via email to