Question

After a Transaction is made in a FragmentActivity, will the Fragment's onActivityCreated() be called?

I populate a ListView in onActivityCreated() with an adapter. I'm hoping the Transaction is another way that will update the list and adapter if needed. Even if that Fragment is already in view and the parent Activity calls a Transaction to the same one.

Or is onCreateView() more suitable?

Was it helpful?

Solution

Don't use the Transaction as a method to update, why on earth would you do that?

That's akin to saying, I'm going to use onDraw in a view as a way to count seconds.

onActivityCreated will only be called when the activity is being created (onCreate()) so unless you destroy the activity, it won't happen.

Hint: http://developer.android.com/reference/android/app/Fragment.html#onActivityCreated(android.os.Bundle)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top