Hi, i am working on a xforms app that uses syncfusions SfAutoComplete control. On UWP the app works like a charm but on android the app hits a uncatched system exception whenever i try to use the SfAutoComplete box. The only part of the log in visual studio that makes any sense is "E/ArrayAdapter(21302): You must supply a resource ID for a TextView". What is this and how can i solve it?
Thanks in advance.
My XML
`<?xml version="1.0" encoding="utf-8" ?>
<ContentPage.Content>
<ScrollView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="4*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<RelativeLayout HeightRequest="40" VerticalOptions="Fill" Grid.Row="0">
<Label Text="Group"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.1,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.1,}" />
<custom:CustomSfAutoComplete HeightRequest="40" x:Name="acGroup"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.2,}"
RelativeLayout.WidthConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.4,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.1,}" />
<Button Text="Draw" x:Name="drawGraphBtn"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.6,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.1,}" />
<Label Text="Stock"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.1,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.3,}" />
<custom:CustomSfAutoComplete HeightRequest="40" x:Name="acStock"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.2,}"
RelativeLayout.WidthConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.4,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.3,}" />
<Label Text="Type"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.1,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.5,}" />
<custom:CustomSfAutoComplete HeightRequest="40" x:Name="acType"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.2,}"
RelativeLayout.WidthConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.4,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.5,}" />
<Label Text="Year"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.1,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.7,}" />
<custom:CustomSfAutoComplete HeightRequest="40" x:Name="acYear"
RelativeLayout.XConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.2,}"
RelativeLayout.WidthConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.4,}"
RelativeLayout.YConstraint =
"{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.7,}" />
</RelativeLayout>
<chart:SfChart x:Name="dataChart" VerticalOptions="Fill" Grid.Row="1" HorizontalOptions="Fill">
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis/>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis/>
</chart:SfChart.SecondaryAxis>
<chart:SfChart.Legend>
<chart:ChartLegend/>
</chart:SfChart.Legend>
</chart:SfChart>
</Grid>
</ScrollView>
</ContentPage.Content>
`
My Code
`using BenderResearchXamarin.Controls;
using BenderResearchXamarin.ViewModels;
using Syncfusion.SfAutoComplete.XForms;
using Syncfusion.SfChart.XForms;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace BenderResearchXamarin.Pages
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FloatingColumn : ContentPage
{
public ObservableCollection _MySourceData { get; set; }
public ObservableCollection _LineSourceData { get; set; }
ViewModelFloatingColumn _ViewModelVSignal;
//Controls
CustomSfAutoComplete _ACGroup;
CustomSfAutoComplete _ACStock;
CustomSfAutoComplete _ACType;
CustomSfAutoComplete _ACYear;
SfChart _Chart;
Button _BtnDraw;
public FloatingColumn()
{
InitializeComponent();
_ViewModelVSignal = new ViewModelFloatingColumn();
_Chart = this.FindByName<SfChart>("dataChart");
_BtnDraw = this.FindByName<Button>("drawGraphBtn");
_BtnDraw.Clicked += _BtnDraw_Clicked;
_ACGroup = this.FindByName<CustomSfAutoComplete>("acGroup");
_ACGroup.SuggestionMode = SuggestionMode.Contains;
_ACGroup.ValueChanged += _ACGroup_ValueChanged;
_ACStock = this.FindByName<CustomSfAutoComplete>("acStock");
_ACStock.ValueChanged += _ACStock_ValueChanged;
_ACType = this.FindByName<CustomSfAutoComplete>("acType");
_ACType.ValueChanged += _ACType_ValueChanged;
_ACYear = this.FindByName<CustomSfAutoComplete>("acYear");
_ACYear.ValueChanged += _ACYear_ValueChanged;
_ACGroup.DataSource = _ViewModelVSignal.VmASBList;
_ACStock.DataSource = _ViewModelVSignal.VmASBList;
_ACType.DataSource = _ViewModelVSignal.VMMetricOptions;
_ACYear.DataSource = _ViewModelVSignal.VMYearEnds;
}
private void _BtnDraw_Clicked(object sender, EventArgs e)
{
_ViewModelVSignal.VMMetricSelected = _ACType.Text.Trim();
_Chart.Title.Text = _ViewModelVSignal.VMMetricSelected;
_ViewModelVSignal.VMYearEndSelected = _ACYear.Text.Trim();
_ViewModelVSignal.UpdateStockShowDetails(_ACStock.Text.Trim());
_ViewModelVSignal.ProcessGenericRequest();
List<Record> List1 = _ViewModelVSignal.ListRecords;
this._LineSourceData = new ObservableCollection<Record>();
for (int i = 0; i < List1.Count(); i++)
{
_LineSourceData.Add(List1[i]);
}
LineSeries Lineseries1 = new LineSeries();
Lineseries1.ItemsSource = this._LineSourceData;
Lineseries1.XBindingPath = "Name";
Lineseries1.YBindingPath = "Amount";
Lineseries1.Color = Color.Green;
RangeColumnSeries rangeSeries = new RangeColumnSeries();
rangeSeries.ItemsSource = _ViewModelVSignal.Collection;
rangeSeries.XBindingPath = "XValue";
rangeSeries.High = "High";
rangeSeries.Low = "Low";
// rangeSeries.ColorModel=
if (_Chart.Series.Any())
{
if (_Chart.Series[0] != null)
{
_Chart.Series.RemoveAt(0);
_Chart.Series.RemoveAt(0);
}
}
_Chart.Series.Add(rangeSeries);
this._Chart.Series.Add(Lineseries1);
}
private void _ACYear_ValueChanged(object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e)
{
var matchingSetups = _ViewModelVSignal.GetMatchingYears(e.Value);
HashSet<string> removeDoubles = new HashSet<string>(matchingSetups.ToList());
((SfAutoComplete)sender).DataSource = null;
((SfAutoComplete)sender).DataSource = removeDoubles;
}
private void _ACType_ValueChanged(object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e)
{
var matchingSetups = _ViewModelVSignal.GetMatchingMetricSetupParameters(e.Value);
HashSet<string> removeDoubles = new HashSet<string>(matchingSetups.ToList());
((SfAutoComplete)sender).DataSource = null;
((SfAutoComplete)sender).DataSource = removeDoubles;
_ViewModelVSignal.VMMetricSelected = e.Value.Trim();
}
private void _ACStock_ValueChanged(object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e)
{
var matchingSetups = _ViewModelVSignal.GetMatchingSetupParameters(e.Value);
HashSet<string> removeDoubles = new HashSet<string>(matchingSetups.ToList());
((SfAutoComplete)sender).DataSource = null;
((SfAutoComplete)sender).DataSource = removeDoubles;
_ViewModelVSignal.UpdateStockShowDetails(e.Value);
}
private void _ACGroup_ValueChanged(object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e)
{
if(_ACGroup._Reason != Reason.Suggestion)
{
var matchingSetups = _ViewModelVSignal.GetMatchingSetupParameters(e.Value);
HashSet<string> removeDoubles = new HashSet<string>(matchingSetups.ToList());
((SfAutoComplete)sender).DataSource = null;
((SfAutoComplete)sender).DataSource = removeDoubles;
_ViewModelVSignal.UpdateGroupShowDetails(e.Value.Trim());
Debug.WriteLine(_ViewModelVSignal.VMGroupShowDetails.Count);
}
}
}
}`
My LOG
05-17 18:33:03.117 V/InputMethodManager(21302): Starting input: tba=android.view.inputmethod.EditorInfo@499f94d nm : BenderResearchXamarin.Android ic=com.android.internal.widget.EditableInputConnection@e12cc02 05-17 18:33:03.118 I/InputMethodManager(21302): [IMM] startInputInner - mService.startInputOrWindowGainedFocus 05-17 18:33:03.122 D/InputTransport(21302): Input channel constructed: fd=81 05-17 18:33:03.122 D/InputTransport(21302): Input channel destroyed: fd=75 05-17 18:33:03.123 D/InputMethodManager(21302): ISS - flag : 0Pid : 21302 view : BenderResearchXamarin.Android 05-17 18:33:03.533 D/ViewRootImpl@9b808de[MainActivity](21302): MSG_RESIZED: ci=Rect(0, 72 - 0, 0) vi=Rect(0, 72 - 0, 846) or=1 05-17 18:33:03.604 D/AbsListView(21302): viewType is heaer or footer 05-17 18:33:05.033 V/InputMethodManager(21302): Starting input: tba=android.view.inputmethod.EditorInfo@74b8ac nm : BenderResearchXamarin.Android ic=com.android.internal.widget.EditableInputConnection@2ff3975 05-17 18:33:05.034 I/InputMethodManager(21302): [IMM] startInputInner - mService.startInputOrWindowGainedFocus 05-17 18:33:05.036 D/InputTransport(21302): Input channel constructed: fd=80 05-17 18:33:05.036 D/InputTransport(21302): Input channel destroyed: fd=81 05-17 18:33:05.042 W/IInputConnectionWrapper(21302): endBatchEdit on inactive InputConnection 05-17 18:33:05.069 D/InputTransport(21302): Input channel constructed: fd=81 05-17 18:33:05.070 D/ViewRootImpl@66cf09d[PopupWindow:dc7b374](21302): setView = android.widget.PopupWindow$PopupDecorView{4207912 V.E...... ......I. 0,0-0,0} touchMode=true 05-17 18:33:05.096 D/mali_winsys(21302): EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000, [432x810]-format:1 05-17 18:33:05.158 D/AbsListView(21302): onsize change 05-17 18:33:05.188 D/ViewRootImpl@66cf09d[PopupWindow:dc7b374](21302): MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1 05-17 18:33:06.287 V/InputMethodManager(21302): Starting input: tba=android.view.inputmethod.EditorInfo@5c6803f nm : BenderResearchXamarin.Android ic=com.android.internal.widget.EditableInputConnection@51fd0c 05-17 18:33:06.288 I/InputMethodManager(21302): [IMM] startInputInner - mService.startInputOrWindowGainedFocus 05-17 18:33:06.291 D/InputTransport(21302): Input channel constructed: fd=86 05-17 18:33:06.291 D/InputTransport(21302): Input channel destroyed: fd=80 05-17 18:33:06.298 W/IInputConnectionWrapper(21302): finishComposingText on inactive InputConnection 05-17 18:33:06.298 W/IInputConnectionWrapper(21302): endBatchEdit on inactive InputConnection 05-17 18:33:06.298 W/IInputConnectionWrapper(21302): getTextBeforeCursor on inactive InputConnection 05-17 18:33:06.335 D/mali_winsys(21302): EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000, [432x90]-format:1 05-17 18:33:06.346 E/ArrayAdapter(21302): You must supply a resource ID for a TextView 05-17 18:33:06.347 D/AndroidRuntime(21302): Shutting down VM