handling activites and layouts android

This question already has an answer here:

  • Saving Android Activity state using Save Instance State 25 answers

  • From Activity2, when clicking Button to go to Activity1 Simply on button.onClickListener Add this.finish();

    And don't explicitly call the Activity1.

    So your data wont be lost.


    只需使用startActivityForResult方法调用activity2并在单击按钮时从activity2调用setResult()然后在activity1 finish并处理onActivityResult事件,以获取更多信息,您可以参阅此Android startActivityForResult和相关的后Handling result

    链接地址: http://www.djcxy.com/p/26202.html

    上一篇: 如何在android中保持会话?

    下一篇: 处理活动和布局android