I'm trying to inflate a layout in another layout but it doesn't work... In my activity I show activity_serie.xml which is black, and then I try to inflate on image_item.xml which is white. But I never see image_item.xml.
public class Serie extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_serie);
ViewPager mainLayout = (ViewPager) findViewById(R.id.serie_pager);
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View menuLayout = inflater.inflate(R.layout.image_item, mainLayout, true);
}
@Override
protected void onResume() {
super.onResume();
}}
The activity_serie.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/serie_pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</RelativeLayout>
The image_item.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#FFFFFF"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
Can someone tell me why? Thanks.