-1

i don't know why there is this error. it want me to add static in my adapter in this code

void setListMovie(ArrayList<Movie> listPresident) {
    this.listPresident = listPresident;
}

but when i add static in it. 'this' in my code become error. this it the my main code that want to add static the adapter class code

ListMovieAdapter.setListMovie(list);

please help why there is this error and how to fix it

Marcin Orlowski
  • 68,918
  • 10
  • 117
  • 136
Qube
  • 480
  • 1
  • 8
  • 22

1 Answers1

1

Declare your method with static key word

public static void setListMovie(ArrayList<Movie> newMoviews) {
listPresident = newMoviews;
} 

and should declare listPresident as static variable

Rajasekaran M
  • 2,235
  • 1
  • 18
  • 24