tags:

views:

65

answers:

1

I am confused, and need to get my concepts straight.

After executing the last statement, which function is called, in MapsActivity? is it onResume? and under which function (onResume()?) should i put getExtra()?

Log.i("onMenuAnimate", "Attempting to animate to:");
Intent intent = new Intent(SearchDB.this, MapsActivity.class);
intent.putExtra("com.gpsdroid.SearchDB.Lat", nameLatitude.getText());
intent.putExtra("com.gpsdroid.SearchDB.Long", nameLatitude.getText());
SearchDB.this.startActivity(intent);
+1  A: 

Take some time to read up on Activity Life cycle; trust me it will help you a lot.

Under the given circumstances, when you call startActivity(..), MapsActivity will be first started by the Activity Manager. In an activity's life cycle, onCreate(..) is called whenever an activity is first created. So this could be one of the places that you can call getExtra().

AFAICT, you can call getIntent.getXXXExtra() in any of the Life Cycle Methods. The answer regarding which of the life cycle methods to choose depends on what is being passed and where/when the information is to be used.

Samuh