我有一个底部导航,它负责切换片段。
因此,每当我单击按钮两次时,片段每次都会在其上重新加载内容。
如何停止该片段 ?我只想向上滚动即可重新加载页面
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View Layout = inflater.inflate(R.layout.fragment_profile, container, false);
ConstraintLayout profile = (ConstraintLayout) Layout.findViewById(R.id.ll);
ImageView imageView = (ImageView) Layout.findViewById(R.id.imageView3);
imageView.setClipToOutline(true);
SharedPreferences sharedPref = getActivity().getSharedPreferences("INFORMATION", 0);
String USERNAME = sharedPref.getString("user","");
TextView username = (TextView) Layout.findViewById(R.id.username);
Typeface custom_font = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Roboto Thin.ttf");
TextView desc = (TextView) Layout.findViewById(R.id.desc);
desc.setTypeface(custom_font);
username.setTypeface(custom_font);
username.setText(USERNAME);
new PostClass(getContext()).execute();
new PostClass_2().execute();
new PostClass_3().execute();
return Layout;
}
每次更改片段时,都会执行以上代码。我想通过像片段中的chrome一样向上滚动来重新加载它。任何帮助表示赞赏
偶然的你
相关分类