On Apr 5, 2012, at 7:11 AM, gnauck wrote:
> When 1 have lists with 200+ items and scroll down the list on the emulator I 
> get randomly an application crash. Visual Studio reports the following errors:
> 
> Unhandled Exception: System.Reflection.TargetInvocationException: Exception 
> has been thrown by the target of an invocation.
> or
> System.NullReferenceException.

What's the Android Debug Log output?

        http://docs.xamarin.com/android/advanced_topics/android_debug_log

My guess is that you're running out of global references, and you'll see a 
message in the debug log similar to:

        
http://docs.xamarin.com/android/troubleshooting#Unexpected_NullReferenceExceptions

> I can cause this problem also with the TablesAndCellStyles examples. Are 
> there any limitations for lists in Android?


I'm not sure where you're getting this sample from.

The emulator has a 2000 global reference limit (hardware has a 52000 limit), 
and each instance of a Java.Lang.Object subclass holds a global reference:

        
http://docs.xamarin.com/android/advanced_topics/architecture#Managed_Callable_Wrappers

As a guess, if you're inheriting from BaseAdapter or some BaseAdapter subclass, 
your GetView() method should reuse the `convertView` parameter, thus minimizing 
the number of objects that are created:

        
https://github.com/xamarin/monodroid-samples/blob/master/ApiDemo/Tutorials/GridViewTutorial.cs#L52

 - Jon

_______________________________________________
Monodroid mailing list
[email protected]

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

Reply via email to