2
I’m trying to do
Database db = new Database(this.getApplicationContext());
Where Database is a class I have with all the methods related to Database and I’m calling to fill an Expandablelist. However, I am getting error in this, the mistake is "Cannot referenced from a static context
".
How can I get the context so as not to get this error?
public class ExpandableList {
public static HashMap<String, List<String>> getData() {
HashMap<String, List<String>> expandableListDetail = new HashMap<String, List<String>>();
List<String> exemplos = new ArrayList<String>();
Database db = new Database(this.getApplicationContext());
(...)
@Thiagoluizdomacoski thank you!! If you want to enter as answer q I accept!
– porthfind