views:

23

answers:

1

I followed @seanhodges sample of the footer bar (android navigation bar bottom) : http://stackoverflow.com/questions/2369975?tab=votes#tab-top

Is it possible to call it from include tag and then access each button at runtime

<LinearLayout android:layout_alignParentBottom="true"
    android:layout_height="wrap_content" android:layout_width="fill_parent">
     <include  android:id="@+id/footer" layout="@layout/footer" /> 
</LinearLayout>

when calling it from the include tag, it looks good on the screen. I try reach the buttons at run time but could get it work..

I know this is not the way but I am looking for something like this...

 Button _BackButton= (Button)findViewById(R.id.footer);

_BackButton.setText("new text");

 Button _Backhome= (Button)findViewById(R.id.footer);

_Backhome.setText("new text");

can it be done through the -include- tag?

thanks

A: 

You should use the ids of the buttons from within the footer layout, using the example you linked to you can get the back button by doing this:

Button _BackButton= (Button)findViewById(R.id.back);

The View hierarchy will be sure to go through the included view when looking for a specified id.

Frank
Its work thanks!
Zohar Adar