Reputation: 1
I have 3 buttons that is modify ,view, clear and i want it to be used in 20 activities. I want to re use the same as if in user control in android? Button 1- Modify, Button 2 - Clear, Button 3- view. Is it good to make common view for all?
Upvotes: 0
Views: 54
Reputation: 1760
You can keep your 3 buttons in another layout say layout_button.xml and then include this in ur activity's layout wherever required like : For ex. this ur activty layout :
<?xml version="1.0" encoding="utf-8"?>
<-- Inflate your other elemnts of ur activity -->
<include
android:layout_width="fill_parent"
android:layout_x="0dp"
android:layout_y="0dp"
layout="@layout/layout_button" />
Upvotes: 2