Hi folks

I got an obscure JNI error calling the following method (on the UI thread).  
Is this something silly I am doing, or is this a xamarin bug?

Motorola Xoom tablet running Jelly Bean 4.1.1, MFA version 4.2.4.


public static class ContextExtensions
    {
        public static float ThemedResourceAttribute(this Context aContext,
int aResourceId)
        {
            TypedValue value = new TypedValue();
            aContext.Theme.ResolveAttribute(aResourceId, value, true);
            IWindowManager windowManager =
aContext.GetSystemService(Context.WindowService).JavaCast<IWindowManager>();
            DisplayMetrics outMetrics = new DisplayMetrics();
            windowManager.DefaultDisplay.GetMetrics(outMetrics);
            return value.GetDimension(outMetrics);
        }
    }





I/dalvikvm(11680): JNI ERROR (app bug): accessed deleted global reference
0xea6007fa
E/dalvikvm(11680): VM aborting
I/mono    (11680): Stacktrace:
I/mono    (11680):
I/mono    (11680):   at (wrapper delegate-invoke)
<Module>.invoke_void__this___intptr_intptr_intptr_JValue[] (intptr,int
ptr,intptr,Android.Runtime.JValue[]) <0xffffffff>
I/mono    (11680):   at Android.Runtime.JNIEnv.CallVoidMethod
(intptr,intptr,Android.Runtime.JValue[]) <0x00053>
I/mono    (11680):   at Android.Views.Display.GetMetrics
(Android.Util.DisplayMetrics) <0x0012f>
I/mono    (11680):   at
KinskyDroid.ContextExtensions.ThemedResourceAttribute
(Android.Content.Context,int) <0x000d3>
I/mono    (11680):   at KinskyDroid.BrowserListAdaptor.PopulateView
(KinskyDroid.BrowserItem,OssToolkitDroid.ViewCache)
<0x001c3>
I/mono    (11680):   at KinskyDroid.BrowserListAdaptor.RecycleItemView
(Android.Content.Context,KinskyDroid.BrowserItem,
OssToolkitDroid.ViewCache) <0x00027>
I/mono    (11680):   at OssToolkitDroid.AsyncArrayAdapter`2.SetItem
(OssToolkitDroid.RecyclingContainerView,ItemType) <0
x000df>
I/mono    (11680):   at OssToolkitDroid.AsyncArrayAdapter`2.GetView
(int,Android.Views.View,Android.Views.ViewGroup) <0x
001d3>
I/mono    (11680):   at
Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_
(intptr,intptr
,int,intptr,intptr) <0x00087>
I/mono    (11680):   at (wrapper dynamic-method)
object.a0997449-19cc-4cdf-92d7-371ec36867e0 (intptr,intptr,int,intptr,i
ntptr) <0x0004b>
I/mono    (11680):   at (wrapper native-to-managed)
object.a0997449-19cc-4cdf-92d7-371ec36867e0 (intptr,intptr,int,intpt
r,intptr) <0xffffffff>



Cheers
Iain



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/jni-error-with-4-2-4-on-jellybean-tp5711456.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to