-2

i have a problem in android studio i want add context in array adapter in fragment class but this is not Acceptance this is image :

enter image description here

and use getContext but not work

appersiano
  • 2,670
  • 22
  • 42
  • Possible duplicate of [Using context in a fragment](http://stackoverflow.com/questions/8215308/using-context-in-a-fragment) – Dan Getz Feb 02 '17 at 20:41
  • Please do not post error messages and code samples as images, as it makes it more difficult for people having similar issues to find your question (and thus its answers). Please copy and paste them directly into the body of the question. – Joe C Feb 02 '17 at 21:39

1 Answers1

0

I suggest you to do two things:

  1. Initialize your arrayList, like: arrayList = new ArrayList();
  2. Use getActivity() instead of this (like suggested by Ricardo Barroca below).

Hope this helps.

Valentino
  • 2,125
  • 1
  • 19
  • 26