Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MonoDroid GetSpans last parameter

I'm trying to use ISpannable in a Monodroid project but am having problems with GetSpans. What I'm ultimately after is a Rich Text editor such as at:

https://code.google.com/p/android-richtexteditor/source/browse/?r=4#svn/trunk/src/net/sgoliver

However, the Xamarin documentation for GetSpans isn't particularly helpful. The line I'm trying to convert from Java to C# is:

StyleSpan[] ss = s.getSpans(styleStart, position, StyleSpan.class);

However, I don't know what to pass for the last parameter as writing StyleSpan.class in C# gives a compile error of "} expected". What can I pass in to the last parameter to get all spans, or all spans of a particular type?

like image 870
Dave W Avatar asked May 13 '13 13:05

Dave W


1 Answers

The C# equivalent should be Java.Lang.Class.FromType(typeof(StyleSpan)).

like image 87
Daniel Hilgarth Avatar answered Sep 19 '22 18:09

Daniel Hilgarth