I'm not sure why you are creating a RadioGroup in the FragmentPagerAdapter, but you can get the context anyway by changing the class constructor:
private Context context; public MyFragmentPagerAdapter(FragmentManager fm, Context c) { super(fm); context = c; }
You can then add context when creating the FragmentPagerAdapter.
source share