You're creating a new instance of your activity with new Catagories()
and then invoke getAllCatagories()
on that. You cannot instantiate activities with new
like that - they will not be set up as Context
s.
Replace
cat.getAllCatagories()
with just
getAllCatagories()
to invoke the method on the current activity instance which is properly set up by the Android app framework.