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
Post a Comment