[英]Change Tab with click the button using ABS
I make this code with base in ActionBarSherlokFragment Demo. 我使用ActionBarSherlokFragment Demo中的基本代码来编写此代码。 I wish that when the user click the Button inside the Tab1 he be directed to Tab2 with this implementation because this implementation contains PageView.
我希望当用户单击Tab1内的Button时,使用此实现将他定向到Tab2,因为该实现包含PageView。 Is possible ?
有可能吗?
Look the code Home: http://pastebin.com/GU63pYM6 查看代码首页: http : //pastebin.com/GU63pYM6
Event Button RelatorioFragment: 事件按钮RelatorioFragment:
bt_vergrafico.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(), "Click", Toast.LENGTH_SHORT).show();
}
});
Try this 尝试这个
@Override
public void onClick(View v) {
mViewPager.setCurrentItem(position);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.