A page startactivityforresult jumps to page B, page B changes data and jumps back to page A. How to close the previous page A?
高洛峰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"
漂亮男人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.
某草草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?