How do I run Android Fragment on Attach()?

Asked 2 years ago, Updated 2 years ago, 53 views

After looking at the life cycle of the fragment, we override all on~~() functions and output them to Log.d.

, but onattach () is not seen as log.

"OnAttach() callback method is called after the fragment is added to activity," but I couldn't print the log.

Is there anything else I need to do if I want to see the on-Attach performance?

How can I see log taken with Logcat?

fragment android

2022-09-22 10:54

1 Answers

Activity on support v4 library FragmentActivity or AppCompatActivity FragmentManager to SupportFragmentManager, We recommend replacing Fragment with a fragment from the support v4 library.


2022-09-22 10:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.