I wrote a little program looking like this:
package com.example.lifecycle;
import android.app.Activity;
import android.content.Context;
import android.os.Bu
Android Framework uses mechanism of Dependencies injection When layout file is inflated.I think due to this onCreateView is called so many times.Formula for this might be as below
Try to remove setContentView and see how many times onCreateView is called.You might get some insights into it.