I have several actions that control the connection ( B => C => D ). If this connection fails, they should all clear and return the result back to A , depending on the reason ( RESULT_USER_TERMINATED, RESULT_LOW_SIGNAL, RESULT_UNKOWN , etc.)
In A, I have
Intent intent = new Intent(this, B.class); startActivityForResult(intent, REQUEST_EXIT_STATUS);
B and C
Intent intent = new Intent(this, C.class); intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); startActivity(myIntent);
In d
Intent intent = new Intent(this, A.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); setResult(ConnectActivity.RESULT_USER_TERMINATED); startActivity(intent);
This does not work. Instead, A gets RESULT_CANCELED . How can I make this work expected? Alternatively, is there a better way to achieve the same result?
source share