public class ImageViewActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
Integer[] ImgPreview = { R.drawable.mlview1, R.drawable.mlview2,
R.drawable.mlview3 };
super.onCreate(savedInstanceState);
setContentView(R.layout.image_prev);
Intent intent = null;
Bundle b = intent.getExtras();
int position = b.getInt("position");
// here, what to do?
if (position == 0) {
}
从上一个活动中,它获取参数“位置”,根据“位置”的值,它应该显示图像。例如:如果位置为 0,则显示图像“mlview1”,依此类推。