Ahh, got it thanks! The issue was this line:
in.readTypedArray(this.board[row], Card.CREATOR);
When creating this method:
private GameState(Parcel in)
I didn't re-create the array, so it was trying to load the array which
hadn't been allocated yet. Seems obvious now, but has stumped me for
days - thanks for walking me through this!!
Thanks again!
James Wright
On Jun 30, 9:54 am, Kostya Vasilyev <[email protected]> wrote:
> James,
>
> The null pointer exception is inside your GameState constructor:
>
> private GameState(Parcel in) {
> .... line 43 is here somewhere .....
>
> }
>
> Seems like the bundle is OK, but the constructor (as above) crashes at
> line 43, and this is seen by the code in onCreate as an exception in
> getParcelableExtra.
>
> -- Kostya
>
> 30.06.2011 17:46, James Wright пишет:
>
> > E/AndroidRuntime( 3798): Caused by: java.lang.NullPointerException
> > E/AndroidRuntime( 3798): at
> > com.jwright.montana.GameState.<init>(GameState.java:43)
> > E/AndroidRuntime( 3798): at
>
> --
> Kostya Vasilyev
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en