lifecycle

When is the Android Fragment onCreateOptionsMenu method called?

Android FAQ: When is the Android Fragment onCreateOptionsMenu method called?

I was just working through a problem with an Android Menu and MenuItem, and added some debug code to the methods in my Android Fragment, and found that the onCreateOptionsMenu method is called after onStart. I didn’t put Log/debug code in every activity lifecycle method, but for the ones I did add logging code to, the specific order of the fragment method calls looked like this:

Understanding the methods in the Scala/Akka Actor lifecycle

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 13.4, “Understanding the methods in the Scala/Akka Actor lifecycle.”

Problem

You’re creating more complicated actors, and need to understand when the methods on an Actor are called.

Solution

In addition to its constructor, an Actor has the following life-cycle methods: