简体   繁体   English

处理ViewPager

[英]Dealing with the ViewPager

So I have a pretty specific problem that I am not sure how to handle. 因此,我有一个非常具体的问题,我不确定如何处理。 I am still in development of an Android app, and part of that app involves a ViewPager and a set of Fragments that act as sort of a wizard (submittal of a report) where the last report in the ViewPager is as submit button that sends data back to the report. 我仍在开发Android应用程序,该应用程序的一部分包含一个ViewPager和一组片段,这些片段充当一种向导(报告的提交),其中ViewPager中的最后一个报告是作为发送数据的提交按钮回到报告。 My problem is when the report is submitted, I need to destroy the ViewPager so that when the user attempts to submit the report again, it is completely new. 我的问题是提交报告时,我需要销毁ViewPager,以便当用户尝试再次提交报告时,它是全新的。 I am looking for a feasible way to accomplish this. 我正在寻找一种可行的方法来实现这一目标。

Create the ViewPager in a separated Activity so when you are done with the Wizard just destory the Activity and call the new Activity with the Main Application. 在单独的活动中创建ViewPager,这样在完成向导后,只需将活动记入层并使用主应用程序调用新的活动即可。 when needed just open the Wizard activity and it will start all over again. 需要时,只需打开向导活动,它将重新开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM