Getting intent extra and the onCreate method?

Since I do not know exactly your Activities flow, this is a solution but may not be the appropriate one.

When you start new activity, put an extra

intent.putExtra("ID_FROM_A", value); // except for ActivityA value = mIdFromA
startActivity(intent);

On the receiving activity

onCreate()
{
    mIdFromA = getIntent().getStringExtra("ID_FROM_A");
}

So if I've got it right:

Activty A:

  • Creates intentAtoB
  • Starts Activity B

Activty B

  • Receives intentAtoB
  • Creates intentBtoC
  • Starts Activity C

Activity C

  • Receive intentBtoC
  • does something

Now: Does Activity C:

  1. return to Activity B using finish(), or

  2. start Activity B again?

If 1, when you return to Activity B, it will still have everything you set up when it was first created. So you need to extract everything from the intent in the onCreate of B.

If 2, you will simply need to pass the information down the chain in the intents you use for starting each activity.

If you could (a) confirm what the sequence if and (b) clarify why the above wont work, I'm sure we can move forwards.