<com_main.xml>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    <xx.xx.xx.Common_topMnu
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_weight="7" />
    <xx.xx.xx.Common_viewPager
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"/>
</LinearLayout>

 

<main.java>

setContentView(R.layout.com_main.xml);

 

----------------------------------------<클래스 공통 레이아웃>---------------------------------

<Common_topMnu.java>

상단 메뉴바 컨트롤

 

<Common_viewPager.java>

ViewPager 컨트롤

---------------------------------------------------------------------------------------------------------

<main_one.xml>

<main_two.xml>

Viewpager에 들어갈 레이아웃

 

형태로 되어있습니다.

 

공통된 레이아웃을 include를 하여 처음으로 만들어 보았습니다.

레이아웃은 어떻게 해서 구성했는데

문제는 main.java에서 ViewPager에 들어간 XML의 리소스를 가져오는데 문제가 있습니다.

 

어떻게 하면 main_one, main_two 의 리소스를 가져올수 있을까요?

 

첨부이미지 올립니다.