I can tell there is no problem in your code. AppCompatActivity is Context itself. So, passing "this" should work anyway.

So as I can see, there is dependency conflict. If you have added appcompat dependency, you don't have to add support V4 dependency too, because supportv4 package comes with appcompat dependency already.

What would I suggest is to remove support v4 dependency and sync with gradle again. it should be fine then,
Even though if it does not work, just do one more step ie.
Click on File -> Invalidate/Cache Restart -> Click on Invalidate cahe and Restart.