how to use getBaseContext() in class which is not extends Activity

Viewed 3686

I am creating a module that extends from another class but i need to use getBaseContext(). how can I use it in my own module? If I have to run the activity then how to do that if not how to solve the problem thanks

public class TelcoModule extends KrollModule
{
...

        // Methods
    @Kroll.method
    public String GetTelco()
    {
           TelephonyManager tm =(TelephonyManager)getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
           String operatorName = tm.getNetworkOperatorName();
           return operatorName ;
          }
}
2 Answers
Related