here is a complex example for your case: Here is a complex example for your case:
noteNote:
- neverNever use a parameter as a variable (parameters shouldn't be modified!)
- I like to use an underscore at the beginingbeginning of global fields (variables,objects objects) names- to better show thetheir scope of them.
- uYou should make a class name without any special characters and beginning with upper casean uppercase letter.
- tryTry to get context from the closest possible parameter (as in my example from the parent of getView()the
getView()method). - The class constructor we defineis defined without a return type! (with name the same name as the class name &and any parameter if You desireyou desire)!
- forFor later data changes in the adapter u, you can define a method to add items to the list (as inan example ).