[英]Android Studio Tabbed Activity (Swipe Views) View Pager Check if Tabbed
I made a new Project in Android Studio with a Tabbed Activity which have the Navigation Style Swipe Views (View Pager). 我在Android Studio中创建了一个带有选项卡式活动的新项目,该选项卡式活动具有导航样式的滑动视图(视图寻呼机)。 How can I now find out which Fragment is active and if the user has tabbed?
现在如何确定哪个Fragment是活动的以及用户是否已选项卡? Is there any way to check that?
有什么办法可以检查吗?
So I made no changes with the Code I just want to check it. 因此,我对代码只做检查就没有做任何更改。
Override setMenuVisibility
method in fragment to check if it is visible or not 覆盖片段中的
setMenuVisibility
方法以检查其是否可见
@Override
public void setMenuVisibility(boolean visible) {
super.setMenuVisibility(visible);
if (visible) {
//do something
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.