you should use oops for this
first create a BaseActivity that extends android.app.Activity. Now it will be parental activity for all your applications. Actions in which you want to display the status bar. Define the entire function associated with the custom status bar and the parent layout to host the views associated with the child Ativity
xml layout for BaseActivity will look like this
<com.abc.xyx.customnotification.CustomDrawer xmlns:my="http://schemas.android.com/apk/res/com.abc.xyx.app" android:id="@+id/drawer" my:direction="topToBottom" android:layout_width="fill_parent" android:layout_height="wrap_content" my:handle="@+id/handle" my:content="@+id/content" android:layout_marginTop="100dp" > <include android:id="@id/content" layout="@layout/slider"/> <ImageView android:id="@id/handle" android:layout_width="wrap_content" android:layout_height="150px" android:visibility="invisible" android:src="@drawable/tooltiparea" /> </com.abc.xyx.customnotification.CustomDrawer> <RelativeLayout > this layout is used for holding child Activities views </RelativeLayout>
create an access method to access the sliding frame and parentLayout.
now your actions to which you want to add customSlidingBar should be continued from BaseActivity so that you only need to copy the code once to deploy the drawer
hope this helps
source share