android - Using Context in FragmentPagerAdapter -


i couldn't use context in fragmentpageradapter. radiogroup(this) gives me undefined error. used getcontext() instead of couldn't achieve it

private static class myfragmentpageradapter extends fragmentpageradapter {    final radiogroup rg = new radiogroup(this);  // can use instead of "this" ?  } 

i not sure why instantiating radiogroup in fragmentpageradapter, anyway can context modifying constructor of class:

private context context;   /** constructor of class */ public myfragmentpageradapter(fragmentmanager fm, context c) {     super(fm);     context = c; } 

then can add context when create fragmentpageradapter.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -