0

Can someone please lists all the activitie's and fragment's life cycle methods which will be called?

I have one activity, that activity has one fragment.

Lets assume that application is running. From fragment I start camera intent. getActivity().startActivityForResult(imageCaptureIntent, ConstantClass.CAMERA_REQUEST); (please notice that I call my activite's startActivityForResult method).

Justinas R.
  • 271
  • 1
  • 4
  • 17
  • http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for/8516056#8516056 – Yaqub Ahmad Jan 23 '13 at 16:40

1 Answers1

2

Activity LifeCycle

http://developer.android.com/reference/android/app/Activity.html

Fragment LifeCycle

http://developer.android.com/guide/components/fragments.html

Instead of posting images of the lifecycle, look at these links that are in the docs. They show the lifecycles which activities and fragments will always follow even if you are using startActivityForResult(). Which exact branch your Activity will take is going to depend on what else you do inside of it like like if you call any lifecycle methods. Basically if you can still see some of the original Activity then onPause() will be called such as with a Dialog or using transparency. If it occupies the whole screen then onStop() would be called.

Other factors could change the direction also. If this isn't what you want to know then you will need to be a little more specific with your question if it appears to be doing something that you don't think it should.

codeMagic
  • 44,549
  • 13
  • 77
  • 93