On Sep 21, 2011, at 8:55 AM, Miljenko Cvjetko wrote:
> ApiDemo.cs gets exception on line 84
> list = list.OrderBy (p => (p.ActivityInfo.NonLocalizedLabel == null ? "" : 
> p.ActivityInfo.NonLocalizedLabel.ToString ()).ToString ()).ToList ();
...
> 09-21 12:36:47.620 E/dalvikvm( 519): Excessive JNI global references (2001)
> 09-21 12:36:47.620 E/dalvikvm( 519): VM aborting
> 09-21 12:36:47.620 I/mono ( 519): Stacktrace:

My guess is that you have the Android API Demo installed on your device. :-)

Since Mono's API demo is (mostly) a port of the Android API Demo, it uses the 
same logic to determine which activitites are "samples" (those with the 
category Intent.CategorySampleCode). The result is that _lots_ of Activity 
instances get pulled in (one GREF apiece), and then you look at the 
ActivityInfo property (another GREF apiece), and then you read the 
PackageItemInfo.NonLocalizedLabel property (another GREF apiece)...and pretty 
soon you're looking at a lot of GREFs.

Unfortunately, if this is the case the answer is "don't do that": either run on 
Hardware (where the GREF limit is significantly higher), or uninstall the 
Android API Demo (so that fewer activities are pulled in), or change the Mono 
API demo code so that it looks for a different set of activities, e.g. look for 
a category in addition to Intent.CategorySampleCode.

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to