Can anyone explain how to avoid the obsolete default constructor for android custom renderers in xamarin forms 2.5?
An example of a custom renderer from 2.4
[assembly: ExportRenderer(typeof(AutoCompleteEntry), typeof(AutoCompleteEntryRenderer))]
namespace MyApp.Droid
{
public class AutoCompleteEntryRenderer : ViewRenderer<AutoCompleteEntry, AutoCompleteTextView>
{
protected override void OnElementChanged(ElementChangedEventArgs<AutoCompleteEntry> e) {
base.OnElementChanged(e);
if (e.OldElement == null && this.Element != null) {
// Perform initialization
}
}
}
}
However adding a new constructor that takes a Context does not work with the ExportRenderer attribute, it will throw an exception on run.
public AutoCompleteEntryRenderer(Context context)
: base(context) {
}
Referencing Forms.Context is also obsolete so I'm just not sure how to get a context reference in 2.5