android include中的控件调用

项目中经常会有一些布局是重用的,但是如何来更好的利用这些布局中的控件

转: http://zhidao.baidu.com/link?url=GU93U8Wu31dfp7mKEx52hMJkxjFLCq3WGkvZ8IMrahQT3wgAbC1Y93sKQ36_GQo3V4-Q9KWRHD6RIxMgBYj0zY7YsYNQuGFGjahZsFnz9wq

<include android:id="@+id/view_counter_buttons_1" layout="@layout/view_counter_button_text" 
android:layout_height="fill_parent"  android:layout_width="fill_parent"/>

RelativeLayout lin = (RelativeLayout)findViewById(R.id.view_counter_buttons_1).findViewById(R.id.layout1);

layout1是view_counter_button_text.xml文件里的ID
原文地址:https://www.cnblogs.com/jiduoduo/p/5211810.html