Wrong requestCode return when using Intent.FLAG_ACTIVITY_CLEAR_TOP

I have 4 Activities A -> B-> C -> D

from Activity D I want to go back to B

here is the code



Activity D

Intent intent = new Intent(AddNewGuest.this, GetAttendance.class);


intent.putExtra("guest", temp);// temp is an object

setResult(600, intent);


on Activity B, I am calling:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

super.onActivityResult(requestCode, resultCode, data);

System.out.println("requestCode:"+requestCode+" resultCode:"+resultCode);


But I am getting the requestCode equals to 1000 where it I am sending it 600

However, when Activity B calls C and before going to D I'm setting requestcode to 1000 startActivityForResult(intent, 1000);

any suggestion?...

Read More »

By: StackOverFlow - Friday, 9 November

Related Posts