If you use “Actions” to display another screen, just perform an operation with some result based on the click of a button, and you can pass some value to the result “Result”, which can then be processed into the onActivityResult of the previous activity.
Adding some pseudo code. Assuming you have two Activations A and B, and you go from A → B, and then from B → A
in action A
startActivityforResult(new Intent(A.this, B.class), 1234); onActivityResult(......) { if (1234 == requestCode) { switch (resultCode) { } } }
in action B
onClick() { if (v == backBtn) { Intent resultIntent = new Intent(); setResult(Activity.RESULT_OK, resultIntent); finish(); } }
source share