package
com.example.sampleviewflipper;
import
android.app.Activity;
import
android.content.Intent;
import
android.os.Bundle;
import
android.view.View;
import
android.view.ViewGroup;
import
android.view.View.OnClickListener;
import
android.widget.Button;
public
class
ScreenViewFlipperActivity
extends
Activity {
protected
void
onCreate1(Bundle savedInstanceState) {
super
.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button startButtoon = (Button) findViewById(R.id.startButtoon);
startButtoon.setOnClickListener(
new
OnClickListener() {
public
void
onClick(View v) {
Intent myIntent =
new
Intent(getApplicationContext(), button1.
class
);
startActivityForResult(myIntent,
1
);
}
});
Button startButtoon2 = (Button) findViewById(R.id.startButtoon2);
startButtoon2.setOnClickListener(
new
OnClickListener() {
public
void
onClick(View v) {
Intent myIntent =
new
Intent(getApplicationContext(), button2.
class
);
startActivityForResult(myIntent,
2
);
}
});
Button startButtoon3 = (Button) findViewById(R.id.startButtoon3);
startButtoon3.setOnClickListener(
new
OnClickListener() {
public
void
onClick(View v) {
Intent myIntent =
new
Intent(getApplicationContext(), button3.
class
);
startActivityForResult(myIntent,
3
);
}
});
Button startButtoon4 = (Button) findViewById(R.id.startButtoon4);
startButtoon4.setOnClickListener(
new
OnClickListener() {
public
void
onClick(View v) {
Intent myIntent =
new
Intent(getApplicationContext(), ScreenViewFlipper.
class
);
startActivityForResult(myIntent,
4
);
}
});
}
ScreenViewFlipper flipper;
@Override
public
void
onCreate(Bundle savedInstanceState) {
super
.onCreate(savedInstanceState);
setContentView(R.layout.main);
ViewGroup.LayoutParams params =
new
ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT);
flipper =
new
ScreenViewFlipper(
this
);
setContentView(flipper, params);
}
}