title: Accessing children's of attached view to window manager
body: <p>How do i access a webview within a layout attached to view to load a page.</p>
  
  <p>I tried some possible ways which i thought could work including </p>
  
  <pre><code>void loadWeb() {
  uiH.post(new Runnable() {
            @Override
            public void run() {
                LoadingWeb  = (WebView) findViewById(R.id.web);
                LoadingWeb.setWebChromeClient(new WebChromeClient());
                LoadingWeb.getSettings().setJavaScriptEnabled(true);
                LoadingWeb.loadUrl("file:///android_asset/www/page.html");
            }
        }); }
  </code></pre>
  
  <p>But is not working</p>
  
  <blockquote>
    <p>java.lang.NullPointerException: Attempt to invoke virtual method
    'boolean android.os.Handler.post(java.lang.Runnable)' on a null object
    reference</p>
  </blockquote>
  
  <p>How do i load a page to the bellow attached view</p>
  
  <pre><code>final IntentFilter theFilter = new IntentFilter();
  theFilter.addAction(myDrawerReceiver);
  this.myDrawingReceiver = new BroadcastReceiver() {
      @Override
      public void onReceive(Context context, Intent intent) {
          final Bundle bundle = intent.getExtras();
          try{
              WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                      WindowManager.LayoutParams.FILL_PARENT,
                      WindowManager.LayoutParams.FILL_PARENT,
                      WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
                      WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
                              WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
                      PixelFormat.TRANSLUCENT);
              params.gravity = Gravity.FILL;
              WindowManager wm = (WindowManager) app.appContext.getSystemService(
                      Context.WINDOW_SERVICE
              );
              if(bundle.get("draw").equals("draw")){
                  loadWeb();
                  wm.addView(myWeb, params);
              }
              else if(bundle.get("draw").equals("undraw")){
                  wm.removeView(myWeb);
              }
          }catch (Exception e){
              Log.d(ussd.TAG,e.toString());
          }
      }
  };
  this.registerReceiver(this.myDrawingReceiver, theFilter);
  </code></pre>
  
  <p>webview <strong>web</strong> is in layout myWeb</p>
  
  <p>Thanks</p>