What more information could you ask for, it has given you the line and the 
exception, obviously tab is null.  Nowhere in the code you supplied have you 
initialized tab  ie you need a line like so:

 

Var tab = new TabOne();

 

From: monodroid-boun...@lists.ximian.com 
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Tomasz Cielecki
Sent: Monday, 21 November 2011 5:20 AM
To: Discussions related to Mono for Android; p...@all-the-johnsons.co.uk
Subject: Re: [mono-android] NullException error

 

tab is probably null then. 

On Nov 20, 2011 2:32 AM, "Paul F. Johnson" <p...@all-the-johnsons.co.uk> wrote:

Hi,

My (slowly) developing Android app seems to have come a cropper with a
very unhelpful error message

Unhandled Exception:

System.NullReferenceException:

and that's it.

I have three tabs. Tab 2 has a reference to tab 1 like this

public class tabTwo : Activity
{
 tabOne tab;
 // etc
}

The button handler looks like this

private void(object s, EventArgs e)
{
 if (tab.var1 == 0 || tab.var2 == 0 || tab.var3 == 0)
 {
   // toast line - you can't have any of these to be zero
   return;
  }
}

The exception is at the tab.var1 line.

Should the throwback be giving more information than that?

Paul
--
Vertraue mir, ich weiss, was ich mache...

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to