In my main view, I have:
public class PlayersActivity extends Activity {
ViewFlipper flipper;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.playercontainer);
flipper = (ViewFlipper) findViewById(R.id.flipper);
}
}
with this view:
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/flipper"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include android:id="@+id/first" layout="@layout/first" />
<include android:id="@+id/second" layout="@layout/playerdetailsview" />
</ViewFlipper>
It displays the first view correctly but I want it to be connected to a java class so I created an FirstActivity class where I can control all my components in the first view but how do I attach the first.xml layout with the FirstActivity java class ?