title: Is it possible to fudge the constructor of WebView with my new Context instead of original Application Context?
body: <p>I want a helper class to evaluate javascript with WebView:</p>
  
  <pre><code>public class EvaluateHelper {
      public static String evaluate(String st){
          WebView w;
          String result;
          //something code to evaluate javascript using WebView;
          return result;
      }
  }
  </code></pre>
  
  <p>But the creation of web view needs a context, I want this class self-contained and do not want to modify other activity class to provide a context, I tried some methods:</p>
  
  <ol>
  <li><p>fulfil with null</p>
  
  <p>WebView w=new WebView(null);</p></li>
  <li><p>fulfil with new Activity</p>
  
  <p>WebView w=new WebView(new Activity());</p></li>
  <li><p>fulfil with context in new Application</p>
  
  <p>WebView w=new WebView(new Application().getApplicationContext());</p></li>
  <li><p>create custom child class from context, then provide my custom class for WebView:</p>
  
  <pre><code>class MyContext extends Context{
      //some override method
  }
  
  WebView w=new WebView(new MyContext());
  </code></pre></li>
  </ol>
  
  <p>but they cause failed to run the app. Is there other way that create a WebView with my Context instead of app original Context? If not, is it possible to make this class self-contained?</p>