Unless I'm misunderstanding something, couldn't you just provide a public
method on your LinearLayout subclass that will do the desired work for you?

As an example, I wrote a subclass to RelativeLayout for one of my apps that
contained a Gallery widget, some text views, and some image views.  In order
to change things at runtime I provided some convenience methods on my
RelativeLayout class that provided the necessary behavior for me...

Here is some sample code that would illustrate how to provide access to a
text view and change its text:

public class TestRelLayout extends RelativeLayout
{
   ...
   public void setTitleText(String text)
   {
      m_titleTextView.setText(text);
   }
   ...
}

On Fri, Mar 4, 2011 at 10:17 AM, feeder1803 <[email protected]>wrote:

> Hi, I am new in Android and I have a problem with the application I am
> developing.
>
> Right now I have an activity that inflates a layout X. In this layout
> there is an custom item that I use as a menu. This item is not a
> default Android widget, it is a custom one that I have down extending
> the LinearLayout class. Inside that widget I have TextViews that I
> press to change the content of the screen. I want to change this item
> on runtime without changing the activity because I would like to
> include a + button to show other options in the same menu.
>
> To do this, I want to call a method from the onscreen activity but the
> onclick method is in the class of the menu. My problem is I don't know
> how to do this. So, how can I do it?
>
>
> MainActivity Layout:
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>
> ............
>
>        <es.uc3m.pfc.nfc.TabBar android:id="@+id/scanTabs"
> pax:tab_id="scan_tab" android:layout_height="@dimen/tab_height"
> android:layout_width="match_parent"/>
>
> ...............
>
> </LinearLayout>
>
>
>
>
>
>
> --
> 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

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