Exception in this method (View.getWindowVisibleDisplayFrame())?
<p>I am getting exception in the method View.getWindowVisibleDisplayFrame(), what can i do for this ? Below is the the logcat response.</p>

<pre><code>progressBar = (ProgressBar) findViewById(R.id.webview_progress);
        webview = (WebView) findViewById(R.id.book_ticket);
        webview.loadUrl("https://www.irctc.co.in/mobile");

        webview.setWebChromeClient(new WebChromeClient(){
            public void onProgressChanged(WebView view, int progress) 
            {
            if(progress &lt; 100 &amp;&amp; progressBar.getVisibility() == ProgressBar.GONE){
                progressBar.setVisibility(ProgressBar.VISIBLE);
            }
            progressBar.setProgress(progress);
            if(progress == 100) {
                progressBar.setVisibility(ProgressBar.GONE);
            }
         }
        });
</code></pre>

<p>Logcat</p>

<pre><code>java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:200)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)
Caused by: java.lang.NullPointerException
at android.view.View.getWindowVisibleDisplayFrame(View.java:4082)
at com.pad.android.util.AdRequest.makeLBRequest(AdRequest.java:113)
at com.pad.android.iappad.AdTask.doInBackground(AdTask.java:70)
at com.pad.android.iappad.AdTask.doInBackground(AdTask.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
... 4 more
</code></pre>
