在和 rel=“nofollow”测试,题为“Adding state management test”的章节,见《乐器开发文件》,它建议重新启动活动:
mActivity.finish();
mActivity = this.getActivity();
Having tried this with the addition of a sleep between the two statements above, I can see that the Activity is not redrawn on the screen when the mActivity = this.getActivity() is executed. My test appears to work, but I am intrigued as to why the Activity isn t redrawn on the screen as this doesn t seem to be mentioned in the API documentation.
我感谢大家对这一看法的任何见解。 在要求采用“完成”方法时,活动从屏幕上消失,但在此时此刻不再发生。 要求采取行动。 我也试图在行为发生后将一种行为性。
My code snippet is now:
...
mActivity.finish();
Thread.sleep(5000);
mActivity = this.getActivity();
Thread.sleep(5000);
...
我进行了广泛的搜索,但找不到任何解释,说明为什么在要求采取主动时活动不会再发生。
我在2.3.5、2.3.3和2.2中测试了所有结果。