>
> and pass it as a parameter to the View constructor
>
Note that findViewById() works on ANY view class... You don't have to call
findViewById from within an Activity.  You can call it on ANY view...
http://developer.android.com/reference/android/view/View.html#findViewById%28int%29

That means, if you have a reference to a RelativeLayout, you can call
findViewById() on that relative layout...

RelativeLayout lyt;
//Initialization code for the relative layout...
lyt.findViewById(R.id.some_view_in_the_layout);

Does that help?

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Fri, Mar 30, 2012 at 8:01 AM, FangQ <[email protected]> wrote:

> hi
>
> The only way I know at this point is to find the button object by ID
> in the main activity class, and pass it as a parameter to the View
> constructor, then one can modify the button status (enabled etc)
> inside another class.
>
> If I have lots of buttons, or other components, to interact, this
> method is very awkward. What would you do in this case?
>
> Qianqian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Discuss" 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-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" 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-discuss?hl=en.

Reply via email to