如何从viewpager的一个按钮调用viewpager

时间:2015-12-16 08:02:20

标签: android android-fragments android-viewpager

如何将一个视图寻呼机调用到另一个视图寻呼机?

https://github.com/mrleolink/SimpleInfiniteCarousel

我遵循上面的代码。

view pager flow image

如果用户点击按钮1,它将调用另一个无限轮播视图寻呼机。


@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

if (container == null) { return null; } LinearLayout l = (LinearLayout) inflater.inflate(R.layout.mf, container, false); final int pos = this.getArguments().getInt("pos"); Button btn = (Button) l.findViewById(R.id.content); btn.setText("position:"+pos); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (pos == 0){ //code something //how to call another view pager (similar as MyFragment). } } }); MyLinearLayout root = (MyLinearLayout) l.findViewById(R.id.root); float scale = this.getArguments().getFloat("scale"); root.setScaleBoth(scale); return l; }

0 个答案:

没有答案