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");
}
题
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?
解决方案
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");
}