Question

I'm starting an activity with startActivity() but there will be times when that activity is already active. In this case I'd like to be able to access extras in the onResume() method.

Is there a way to do this?

Était-ce utile?

La solution

not tested
just override onResume in activity class like this

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
    Intent intent = getIntent();
            intent.getExtras().getString("foo");
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top