I would like to launch new activity under instantiateItem() Function. What i understand about this function is that it is just allowed to add TextView under this function itself. Is is possible to create new activity or intent below the function ? Codes are described as below.
@Override
public Object instantiateItem(View container, int position) {
RelativeLayout v = new RelativeLayout(mContext);
TextView t = new TextView(mContext);
t.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
t.setText(mData[position]);
t.setTextSize(30);
t.setGravity(Gravity.CENTER);
v.addView(t);
((ViewPager) container).addView(v, 0);
return v;
}
If you want diffrent layout for each page then you can do something like this, in
instantiateItemand