-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
  • 72,056
  • 11
  • 123
  • 141
Qube
  • 543
  • 3
  • 9
  • 23

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,478
  • 2
  • 20
  • 30