Android arrayAdapter and BaseAdapter getContext ? why getContext works on array adapter but not on base adapter?
By : elizabethanns
Date : March 29 2020, 07:55 AM
To fix the issue you can do Well, the ArrayAdapter extends BaseAdapter and has a context variable in its constructor which is saved and can be accessed using getContext(). Whereas, BaseAdapter has an empty constructor. You don't provide one to it, so you can't get it from the base class. If you need one, make your own constructor like the ArrayAdapter class did and save your context there.