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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -