Вопрос

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");
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top