Java NullPointerException [I'm A Java Noob]
I get a NullPointerException when I try to run this, can anyone tell me why? I'm using the Android SDK, and the jsoup stuff is from an external JAR that I added to my project.

I'm really stuck and I've read other posts about NullPointerExceptions and couldn't seem to find an answer.

    package danny.projects.workstationmonitor;
    
    import danny.projects.workstationmonitor.R;
    import danny.projects.workstationmonitor.ourViewClient;
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.os.Bundle;
    import android.text.Html;
    import android.view.View;
    import android.webkit.WebChromeClient;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    import android.widget.EditText;
    import org.jsoup.Jsoup;
    import org.jsoup.helper.Validate;
    import org.jsoup.nodes.Document;
    import org.jsoup.nodes.Element;
    import org.jsoup.select.Elements;
    import java.io.*;
    
    
    
    
    
    public class WorkstationMonitorActivity extends Activity implements View.OnClickListener{
    	
    	EditText url;
    	WebView ourBrow;
    	
    	
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.monitor);
            ourBrow = (WebView) findViewById(R.id.wvBrowser);
            ourBrow.setWebViewClient(new ourViewClient());
            ourBrow.getSettings().setJavaScriptEnabled(true);
        	ourBrow.loadUrl("http://localhost/pcp/test.html");
        	
        	
    
    		Document document = null;
    		try {
    			document = Jsoup.connect("http://localhost/pcp/test.html").get();
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
            String question = document.select("p").first().text();
            System.out.println(question);
            
            ourBrow.setWebViewClient(new WebViewClient() {  
            	
            	
    
            });
            
            
        }
        
        public void onClick(View v){}
        
        public void alertBtn(View v){
        	
        	new AlertDialog.Builder(this)
        	.setTitle("ALERT: WORKSTATION WAS LOCKED AT 4:09PM")
        	.setMessage("Your workstation was locked due to the security input alarm being set off at 4:09pm.")
        	.setNegativeButton("Show Options", new DialogInterface.OnClickListener() {
    			
    			public void onClick(DialogInterface dialog, int which) {
    				setContentView(R.layout.inputalarmsounded);
    				
    			}
    		})
        	.setNeutralButton("Ignore and Unlock", null)
        	.show();
        }
        
        public void openApp(){
        	
        }
    }

Java NullPointerException [I'm A Java Noob]
===

I get a NullPointerException when I try to run this, can anyone tell me why? I'm using the Android SDK, and the jsoup stuff is from an external JAR that I added to my project.

I'm really stuck and I've read other posts about NullPointerExceptions and couldn't seem to find an answer.

    package danny.projects.workstationmonitor;
    
    import danny.projects.workstationmonitor.R;
    import danny.projects.workstationmonitor.ourViewClient;
    import android.app.Activity;
    import android.app.AlertDialog;
    import android.content.DialogInterface;
    import android.os.Bundle;
    import android.text.Html;
    import android.view.View;
    import android.webkit.WebChromeClient;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;
    import android.widget.EditText;
    import org.jsoup.Jsoup;
    import org.jsoup.helper.Validate;
    import org.jsoup.nodes.Document;
    import org.jsoup.nodes.Element;
    import org.jsoup.select.Elements;
    import java.io.*;
    
    
    
    
    
    public class WorkstationMonitorActivity extends Activity implements View.OnClickListener{
    	
    	EditText url;
    	WebView ourBrow;
    	
    	
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.monitor);
            ourBrow = (WebView) findViewById(R.id.wvBrowser);
            ourBrow.setWebViewClient(new ourViewClient());
            ourBrow.getSettings().setJavaScriptEnabled(true);
        	ourBrow.loadUrl("http://localhost/pcp/test.html");
        	
        	
    
    		Document document = null;
    		try {
    			document = Jsoup.connect("http://localhost/pcp/test.html").get();
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
            String question = document.select("p").first().text();
            System.out.println(question);
            
            ourBrow.setWebViewClient(new WebViewClient() {  
            	
            	
    
            });
            
            
        }
        
        public void onClick(View v){}
        
        public void alertBtn(View v){
        	
        	new AlertDialog.Builder(this)
        	.setTitle("ALERT: WORKSTATION WAS LOCKED AT 4:09PM")
        	.setMessage("Your workstation was locked due to the security input alarm being set off at 4:09pm.")
        	.setNegativeButton("Show Options", new DialogInterface.OnClickListener() {
    			
    			public void onClick(DialogInterface dialog, int which) {
    				setContentView(R.layout.inputalarmsounded);
    				
    			}
    		})
        	.setNeutralButton("Ignore and Unlock", null)
        	.show();
        }
        
        public void openApp(){
        	
        }
    }
