package com.bignerdranch.android.criminalintent;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class CrimeFragment extends Fragment {

    private Crime mCrime;
    private TextView mTitleField;

    @Override public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        mCrime = new Crime();
    }

    @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        View view = inflater.inflate(R.layout.fragment_crime, container, false);

        mTitleField = (TextView)view.findViewById(R.id.crime_title);

        return view;
    }
}

@@ -153,16 +153,79 @@
 agment;%0A
+import android.text.Editable;%0Aimport android.text.TextWatcher;%0A
 import a
@@ -878,16 +878,460 @@
 _title);
+%0A        mTitleField.addTextChangedListener(new TextWatcher() %7B%0A            @Override%0A            public void beforeTextChanged(CharSequence s, int start, int count, int after) %7B%7D%0A%0A            @Override%0A            public void onTextChanged(CharSequence s, int start, int before, int count) %7B%0A                mCrime.setTitle(s.toString());%0A            %7D%0A%0A            @Override%0A            public void afterTextChanged(Editable s) %7B%7D%0A        %7D);
 %0A%0A      

Implement text listener for title field in crime fragment