Android Custom Arrayadapter Constructor Issue
Solution 1:
Just because the constructor you are defining takes a certain parameter list, it doesn't mean the super class has that constructor. After all, you can define any arbitary parameter list for your constructor.
The super constructor you are trying to call is closest to ones in the ArrayAdapter class, but the error message suggests you are trying to inherit from SimpleAdapter. Have you got this right? If it should be ArrayAdapter, the last argument needs to be the array (or List) of the objects which back the adapter, instead of just a single object of that type.
If it is SimpleAdapter, the only constructor is here, which looks quite a bit different.
- Error:(28) Error: This Class Should Provide A Default Constructor (a Public Constructor With No Arguments) (myclassname.helpdialog) [instantiatable]
- How Exactly Does Jvm Compile Ternary Operators? Should I Be Concerned About Different Api Versions?
- Pass Data To Another Fragment By Swipe View With Tab Android Studio,not Button
Solution 2:
super
is used to call the constructor of the superclass, the class you're extending. Look at the documentation: the constructor of SimpleAdapter
has different arguments.
Post a Comment for "Android Custom Arrayadapter Constructor Issue"