I have implemented a custom Array Adapter and though the app works fine, but I get this error when on super line:
Unchecked call to ArrayAdapter(Context, int, T[]) as a member of raw type Android.Widget.ArrayAdapter
This is my custom ArrayAdapter:
class MyArrayAdapter extends ArrayAdapter {
public MyArrayAdapter(Context context, int textViewResourceId, Object[] objects)
{
super(context, textViewResourceId, objects);
}
.
.
.
super is highlighted as error.
How can I fix this?
Change your class declaration to:
class MyArrayAdapter extends ArrayAdapter<Object>
By the way consider using something more specific than Object
- it will be more convenient for you too.
If you take a look at the ArrayAdapter class, it's a generic class
. So you have to specify which type of datas will be manipulate through your adapter. For example, if you manipulate Strings :
class MyArrayAdapter extends ArrayAdapter<String> {
//
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With