Uncaught exception with onListItemClick using parcelable
<p>I'm getting an Uncaught exception with onListItemClick using parcelable and I have exhausted all avenues possible in search of an answer. The app is a birdwatching app that uses a standard listview with a custom adapter which links to a detail activity. The birds and their details are stored locally using SQLite. Any help much appreciated..</p>

<p>Just to add.. this is my first app and first post here, so be kind..</p>

<p>Here is my onListItemClick method:</p>

<pre><code>@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    Bird bird = birds.get(position);

    Intent intent = new Intent(this, Profile.class);
    intent.putExtra(".model.Bird", bird);
    startActivity(intent);
}
</code></pre>

<p>Here is my Profile class:</p>

<pre><code>public class Profile extends Activity{

Bird bird;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.profile);

    Bundle b = getIntent().getExtras();
    bird = b.getParcelable(".model.bird");

    refreshDisplay();

}
</code></pre>

<p>And here is my model (without setters and getters):</p>

<pre><code>public Bird() {
    super();
}

public Bird(Parcel in) {
     //Log.i(ReferenceGuide.LOGTAG, "Parcel constructor");

     id = in.readLong();
     name = in.readString();
     latin_name = in.readString();
     description = in.readString();
     habitat = in.readString();
     diet = in.readString();
     breeding = in.readString();
     wintering_habits = in.readString();
     where_to_see = in.readString();
     conservation = in.readString();
     image = in.readString();
     primary_colour = in.readInt();
     secondary_colour = in.readInt();
     crown_colour = in.readInt();
     bill_length = in.readInt();
     bill_colour = in.readInt();
     tail_shape = in.readInt();
     created_at = in.readString();
     upated_at = in.readString();
}
@Override
public int describeContents() {
     return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
     //Log.i(ReferenceGuide.LOGTAG, "writeToParcel");

     dest.writeLong(id);
     dest.writeString(name);
     dest.writeString(latin_name);
     dest.writeString(description);
     dest.writeString(habitat);
     dest.writeString(diet);
     dest.writeString(breeding);
     dest.writeString(wintering_habits);
     dest.writeString(where_to_see);
     dest.writeString(conservation);
     dest.writeString(image);
     dest.writeInt(primary_colour);
     dest.writeInt(secondary_colour);
     dest.writeInt(crown_colour);
     dest.writeInt(bill_length);
     dest.writeInt(bill_colour);
     dest.writeInt(tail_shape);
     dest.writeString(created_at);
     dest.writeString(upated_at);
}

public static final Parcelable.Creator&lt;Bird&gt; CREATOR =
          new Parcelable.Creator&lt;Bird&gt;() {

     @Override
     public Bird createFromParcel(Parcel source) {
          //Log.i(ReferenceGuide.LOGTAG, "createFromParcel");
          return new Bird(source);
     }

     @Override
     public Bird[] newArray(int size) {
          //Log.i(ReferenceGuide.LOGTAG, "newArray");
          return new Bird[size];
     }
};
</code></pre>

<p>Edit: Here is logcat output:</p>

<pre><code>02-28 15:43:38.048: W/dalvikvm(16350): threadid=1: thread exiting with uncaught exception (group=0x41cfe468)
02-28 15:43:38.058: E/AndroidRuntime(16350): FATAL EXCEPTION: main
02-28 15:43:38.058: E/AndroidRuntime(16350): java.lang.NullPointerException
02-28 15:43:38.058: E/AndroidRuntime(16350):    at com.example.birdnote.ReferenceGuide.onListItemClick(ReferenceGuide.java:89)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.app.ListActivity$2.onItemClick(ListActivity.java:319)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.widget.AdapterView.performItemClick(AdapterView.java:298)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.widget.AbsListView.performItemClick(AbsListView.java:1150)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.widget.ListView.performItemClick(ListView.java:4397)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:2985)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.widget.AbsListView$1.run(AbsListView.java:3671)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.os.Handler.handleCallback(Handler.java:615)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.os.Handler.dispatchMessage(Handler.java:92)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.os.Looper.loop(Looper.java:155)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at android.app.ActivityThread.main(ActivityThread.java:5454)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at java.lang.reflect.Method.invokeNative(Native Method)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at java.lang.reflect.Method.invoke(Method.java:511)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
02-28 15:43:38.058: E/AndroidRuntime(16350):    at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>Edit 2: 
The code where I set up <code>Birds</code>:</p>

<pre><code>private List&lt;Bird&gt; birds;

// create reference to database
BirdsDataSource datasource;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.reference_guide);

   // open connection to db
    datasource = new BirdsDataSource(this);
    datasource.open();

    // get list of birds from db 
    List&lt;Bird&gt; birds = datasource.findAll();  
    if(birds.size() == 0) {
        createData();
        birds = datasource.findAll();
    }

    // set view adapter
    ArrayAdapter&lt;Bird&gt; adapter = new CustomBaseAdapter(this, birds);
    setListAdapter(adapter);
}
</code></pre>

<p>The list view populates fine from the database using <code>Birds</code></p>
