Home  >  Q&A  >  body text

Android page close

A page startactivityforresult jumps to page B, page B changes data and jumps back to page A. How to close the previous page A?

阿神阿神2730 days ago688

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-05-16 13:25:31

    Go to the manifest.xml file and change the startup mode of activity A to the following

    android:launchMode="singleTask"

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:25:31

    A Activity has a method called onActivityResult(). When the Activity started by startActivityForResult() is launched, it will enter this function. You can do relevant processing in it and then finish();

    You can go to Baidu yourself for the specific method. It is really inconvenient for you to find it on your mobile phone.

    reply
    0
  • 某草草

    某草草2017-05-16 13:25:31

    A -> startActivityForResult() -> B
    Why don’t I understand the problem? You use startActivityForResult in A to start B. Doesn’t this mean that you expect B to return results to A? Why does A have to be closed when B returns?

    reply
    0
  • Cancelreply