Android Noteadv2. The confirm button has no click listener
<p>I'm looking at the Noteadv2 in the android tutorials. Everything works just hunky dory, but one small thing. My "confirm button" has no on-click listener. I know why this happens and the code from the solution is effectively identical, but the expectation the tutorial gives you is that you should be able to create and delete a note. So far.. no good.</p>

<p>So we start our call stack in creating the activity in Notepadv2.onMenuItemSelected(...). It says stuff like this:</p>

<pre><code>@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    switch(item.getItemId()) {
    case INSERT_ID:
        createNote();
        return true;
    }

    return super.onMenuItemSelected(featureId, item);
}
</code></pre>

<p>Then our friend createNote() says:</p>

<pre><code>    private void createNote() {
       Intent i = new Intent(this, NoteEdit.class);
       startActivityForResult(i, ACTIVITY_CREATE);
    }
</code></pre>

<p>So android, so nicely, routes a request and CRUDs us a a NoteEdit class based on our manifest. All great so far. Here's the funny bit in NoteEdit.onCreate():</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {        
    super.onCreate(savedInstanceState);

    setContentView(R.layout.note_edit);
    setTitle(R.string.edit_note);

    mTitleText = (EditText) findViewById(R.id.title);
    mBodyText = (EditText) findViewById(R.id.body);
    Button confirmButton = (Button) findViewById(R.id.confirm);

    mRowId = null;
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
</code></pre>

<p>the last two lines are the crux. After this point we add a click event listener on the confirm button, which never gets done. </p>

<p>When we yank the extras out of the current intent for our activity, those extras are not there. Makes sense right? They were never set cuz this is new.. since the extras are null the if-statement drops out and we get stuck on the edit screen while debugging.</p>

<p>Is there a default setting I missed. Did I skip a step or is eclipse playing silly bugger again?</p>

<p>Thanks for reading.</p>
