Add sample for activity and fragment lifecycle