0

So I'm trying to follow the following instructions here https://stackoverflow.com/a/10996569/1358857

public class ClassB { 
   Context context;
   public ClassB(Context context){
     this.context=context;
   } 
} 

However when I go to make a constructor I get the following autogenerated and I'm worried to add a Context property to it.

public MainActivity(MainFragmentAdaptor mMainFragmentAdaptor) {
    this.mMainFragmentAdaptor = mMainFragmentAdaptor;
}

Just so you are aware yes I'm using a fragment for my app

MainFragmentAdaptor is a FragmentManager.

public class MainFragmentAdaptor extends FragmentPagerAdapter {
    public MainFragmentAdaptor(FragmentManager fm) {
        super(fm);
    }
}

I'm not sure why my app doesn't have a context, should I add a context to it?

Or should I treat my FragmentAdapter as a Context (I have no clue)?

Gideon Sassoon
  • 544
  • 1
  • 9
  • 29

0 Answers0