I have a CustomAdapter with the following constructor
[HIGH]
public TemperatureAdapter(Context context, int layoutResourceId, Temperature[] data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.context = context;
this.data = data;
}
[/HIGH]
This is being fed [HIGH]List<Temperature> temperatures [/HIGH] from a method in an Async task.
and the adapter line is
[HIGH]TemperatureAdapter adapter = new TemperatureAdapter(TemperatureActivity.this, R.layout.temperature_edit_row, (Temperature[]) ( temperatures.toArray());[/HIGH]
My problem is:
java.lang.Object[] cannot be cast to com.android.sentinelwater.SWObjects$Temperature[]
The code complies but runtimes. Nothing I try works. I must be missing something, any Genii out there?
[HIGH]
public TemperatureAdapter(Context context, int layoutResourceId, Temperature[] data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.context = context;
this.data = data;
}
[/HIGH]
This is being fed [HIGH]List<Temperature> temperatures [/HIGH] from a method in an Async task.
and the adapter line is
[HIGH]TemperatureAdapter adapter = new TemperatureAdapter(TemperatureActivity.this, R.layout.temperature_edit_row, (Temperature[]) ( temperatures.toArray());[/HIGH]
My problem is:
java.lang.Object[] cannot be cast to com.android.sentinelwater.SWObjects$Temperature[]
The code complies but runtimes. Nothing I try works. I must be missing something, any Genii out there?
