Java Error: Cannot make a static reference to the non-static method

Because you are accessing the method with static reference

DatabaseHandler.updateScores(listScore);   

means with class name..

You have to make a instance of DatabaseHandler class and use that method.

Or make a updateScores as static method like,

static public void updateScores()

But I have a doubt you have more codes in DatabaseHandler Class. (As its sqlite database helper class you are using Activity context in this class) so better to make instance of DatabaseHandler class and use method updateScores() with instance.

Leave a Comment