Hi,

I'm using Mono for Android 1.9. evaluation and I'm having problems with tab
host. I defined layout exactly as described in MfA Tab Layout tutorial,
except instead of using "android:id="@android:id/tabhost" i used
"android:id="@+id/tabhost" because the compiler couldn't recognize the first
definition which probably means that Resource class wasn't generated
correctly. Maybe that has something to do with my problems.

I tried the following (creating tabs without icons and state list drawable):

1.) Main activity inherits from TabActivity, I'm using the inherited TabHost
property to add tabs, exactly as in MfA tutorial. The app crashes in
SetContentView(Resource.Layout.Main). I tried deleting the code where tabs
are added but that didn't help.

2.) Main activity inherits from ActivityGroup (I also tried inheriting from
Activity out of desperation). The tab host is initialized as "TabHost
tabHost = FindViewById<TabHost>(Resource.Id.tabhost)". The app crashes when
I call "tabHost.Setup()". If I skip the "Setup()" method it crashes when I
try to add a tab.

The same happens in VisualStudio 2010 and MonoDevelop 2.8 beta 3, using MfA
1.2. or 1.9. I tried creating 1.6., 2.1., 2.2. and 2.3. projects running on
respective emulators. I remember that tabs worked in one of the earlier
versions of MfA on MonoDevelop but I don't remember which one as it was a
few months ago.

Copy of call stack and error messages from MonoDevelop is below.

As this is quite a showstopper, any help would be greatly appreciated.

Best regards,
Niko Delic

Call stack:

System.Object.735ab3fe-72ee-4e3d-8a27-a7597a69c0f0 (arg0=0xabe0,
arg1=0x4068c2b0, arg2=0x0) in 

Error message(s) #1:

System.NullReferenceException: Object reference not set to an instance of an
object
  at MonoDevelop.Debugger.ObjectValueTreeView.SetValues (TreeIter parent,
TreeIter it, System.String name, Mono.Debugging.Client.ObjectValue val)
[0x0000d] in
/private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:631
 
  at MonoDevelop.Debugger.ObjectValueTreeView.AppendValue (TreeIter parent,
System.String name, Mono.Debugging.Client.ObjectValue val) [0x00034] in
/private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:618
 
  at MonoDevelop.Debugger.ObjectValueTreeView.Refresh () [0x00091] in
/private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:467
 
  at MonoDevelop.Debugger.ObjectValueTreeView.AddValue
(Mono.Debugging.Client.ObjectValue value) [0x0000c] in
/private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs:415
 
  at MonoDevelop.Debugger.ExceptionCaughtDialog.Fill () [0x00084] in
/private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:82
 
  at MonoDevelop.Debugger.ExceptionCaughtDialog.<HandleExceptionChanged>m__0
(System.Object , System.EventArgs ) [0x00000] in
/private/tmp/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:63
 
  at Gtk.Application+InvokeCB.Invoke () [0x00000] in <filename unknown>:0 
  at GLib.Timeout+TimeoutProxy.Handler () [0x00000] in <filename unknown>:0 

Error message #2:

Java.LangRuntimeException has been thrown

Details tab:
Name: Instance
Value: System.NullReferenceException: Object reference not set to an
instance of an object




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/TabActivity-TabHost-crash-tp4869491p4869491.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

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

Reply via email to