http://mono-for-android.1047100.n5.nabble.com/file/n5049949/MonoAndroid4Test.zip MonoAndroid4Test.zip
I have an ArrayAdapter<int> as a datasource to a spinner. The code blows up when the adapter tries to get an item. It seems like it works if T is a string but not if T is an int. This was working previously for sure. Sample project attached. Here is the log I/test (19493): string : val = 1,SelectedItemPosition = 0,v.Adapter is null : False I/test (19493): string: Adapter.Count = 12 I/test (19493): string: Adapter.GetItem(0) I/test (19493): after string selection I/test (19493): val = 1,SelectedItemPosition = 0,v.Adapter is null : False I/test (19493): Adapter.Count = 12 I/mono (19493): Stacktrace: I/mono (19493): I/mono (19493): at Android.Runtime.JNIEnv.GetObjectClass (intptr) <0x0003f> I/mono (19493): at Android.Runtime.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x0006f> I/mono (19493): at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x00267> I/mono (19493): at Java.Lang.Object._GetObject<T> (intptr,Android.Runtime.JniHandleOwnership) <0x0004f> I/mono (19493): at Java.Lang.Object.GetObject<T> (intptr,Android.Runtime.JniHandleOwnership) <0x0002b> I/mono (19493): at Android.Widget.ArrayAdapter.GetItem (int) <0x0022b> I/mono (19493): at MonoAndroid4Test.Activity1.OnCreate (Android.OS.Bundle) <0x00633> I/mono (19493): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005f> I/mono (19493): at (wrapper dynamic-method) object.96b38cf9-49a9-479b-856f-42158dabe849 (intptr,intptr,intptr) <0x00033> I/mono (19493): at (wrapper native-to-managed) object.96b38cf9-49a9-479b-856f-42158dabe849 (intptr,intptr,intptr) <0xffffffff> E/mono (19493): E/mono (19493): Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object E/mono (19493): at Android.Runtime.JNIEnv.GetObjectClass (IntPtr jobject) [0x00000] in <filename unknown>:0 E/mono (19493): at Android.Runtime.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x00000] in <filename unknown>:0 E/mono (19493): at Java.Lang.Object.GetObject (IntPtr handle, JniHandleOwnership transfer, System.Type type) [0x00000] in <filename unknown>:0 E/mono (19493): at Java.Lang.Object._GetObject[Object] (IntPtr handle, JniHandleOwnership transfer) [0x00000] in <filename unknown>:0 E/mono (19493): at Java.Lang.Object.GetObject[Object] (IntPtr handle, JniHandleOwnership transfer) [0x00000] in <filename unknown>:0 E/mono (19493): at Android.Widget.ArrayAdapter.GetItem (Int32 position) [0x00000] in <filename unknown>:0 E/mono (19493): at MonoAndroid4Test.Activity1.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0 E/mono (19493): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr na -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/MonoDroid4-Previously-working-ArrayAdapter-int-not-working-any-more-tp5049949p5049949.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
