I am a little helpless this time.
I have a code
list of public class adapter & lt; String & gt; Extension of array adapter & lt; String & gt; {Personal Final Reference Reference; Private Final Ink Text ViewResourceId; Private fin int [] itemResourceIds; Private Final Arrestist & lt; String & gt; List; Public ListViewAdapter (REFERENCES, int textViewResourceId, int [] itemResourceIds, ArrayList & lt; String & gt; list) {super (context, text ViewResourceId, itemResourceIds, list); This.context = context; This.textViewResourceId = textViewResourceId; This.itemResourceIds = itemResourceIds; This.list = list; } @ Override public view getView (view the status of int, viewviewparent ViewGroup) {// some code ...}}
but the eclipse marks the super (...) line And I do not know why.
It tells me:
Creator Ara adapter & lt; String & gt; (Context, integer, int [], arreite & lt; string & gt;)
But did I not define it properly?
Please help me here
When you use Super, you have to call one of the parent class defined constructors
ArrayAdapter, as you can see, there are available constructor: ArrayAdapter (rEFERENCES, int Resources) ArrayAdapter (rEFERENCES, int resource, int textViewResourceId) ArrayAdapter (rEFERENCES, int resource, string [] Objects) ArrayAdapter (reference reference, int resource, int textViewResourceId, string [] objects) ArrayAdapter ( REFERENCES, int Resource List & lt; String & gt; objects) Arra YAdapter (REFERENCES, Int resources, Int text Wuarssorsaidi List & lt; T & gt;
If you one of them must call
and you are calling
super (context, text view report Aiaraidi, Aitiarsosaiaidiais list); that ArrayAdapter (context, int, Int [], Arrayist) and do not exist.
Instead of an array of int, itemResourceIds
wants to be an integer Hey
How to fix it depends on the content of the item Resources [];
It think:
ArrayAdapter (REFERENCES, Int resources, Int text Wuarssorsaidi, List & lt; String & gt; objects)
An XML layout receives the ID of the file, and then the ID of a text field.
And this
ArrayAdapter (reference references, int resource, list & lt; T & gt; objects)
only id Receives XML file
Maybe you just want to call
super (context, mdrsosource id [0], textusource source id, list);
or just
super (reference, item processing IIS [0], list);
But it depends on what the content of itemResourceIds
is actually
If you are implementing the entire adapter, So you do not really care about what ID you are sending to parents, so that you can call it
super (context, 0, list);
Because no one is in the class to use it
Anyway, if you are ready to implement everything to yourself, code> BaseAdapter instead of ArrayAdaper to expand because Besadetr does not require any parameter in the constructor, and maybe you do not need any functionality Araadaptr.
Comments
Post a Comment