Moved the adapter to a new class.

The getActivity is null which is being passed to the constructor of adapter. This is causing the app to crash.