Android ProgressDialog context problems
Quick summary: I'm making an application that parses a binary file, stores vertices and their properties, and displays them in openGL. I'm trying to implement a **ProgressDialog** while it parses, but I'm having considerable trouble. I've tried implementing this in many places, but this is my current setup:

        public class PointViewer extends Activity{
         ...
        	@Override
        	public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                
                Bundle extras = getIntent().getExtras();
                filePath = extras.getString("file_path");
        
                mGLView = new GLSurfaceView(this);
                theRenderer = new OpenGLRenderer();
                mGLView.setRenderer(theRenderer);
                //Parse the file and set the arrays
                theRenderer.setLAS(filePath);
                setContentView(mGLView);
        
        	}
         ...
        }

The Rendering class...

    public class OpenGLRenderer extends Activity implements GLSurfaceView.Renderer {
             ...
                public void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    
            	}
                
                public void setLAS (String fileName){
                	
                	new ProgressTask(this).execute();
                	
            
                }
            ...
            /*
             * The class for the progress dialog 
            */
            private class ProgressTask extends AsyncTask<String, Void, Boolean> {
               private ProgressDialog dialog;
               private Context context;
     
               //private List<Message> messages;
               public ProgressTask(Context ctx) {
               
                   context = ctx;
                   dialog = new ProgressDialog(context);
               }
    
    
    
               /** progress dialog to show user that the backup is processing. */
    
               protected void onPreExecute() {
                   this.dialog.setMessage("Progress start");
                   this.dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
                   this.dialog.show();
               }
    
                @Override
               protected void onPostExecute(final Boolean success) {
                
    
                   if (dialog.isShowing()) {
                       dialog.dismiss();
                   }
    
                   if (success) {
                       Toast.makeText(context, "OK", Toast.LENGTH_LONG).show();
                   } else {
                       Toast.makeText(context, "Error", Toast.LENGTH_LONG).show();
                   }
               }
    
               protected Boolean doInBackground(final String... args) {
                   try{    
                   	ptCloud = new PointCloud(args[0]);
       
                      	...
    
                       dialog.setProgress(percentParsed);
                       return true;
                    } catch (Exception e){
                       Log.e("tag", "error", e);
                       return false;
                    }
                 }
    
    
    }
       

When I call **dialog = new ProgressDialog(context);** It errors on a null pointer exception, I'm assuming because there is a context issue... Does anyone have any ideas? Thank you in advance!
Android ProgressDialog context problems
===

Quick summary: I'm making an application that parses a binary file, stores vertices and their properties, and displays them in openGL. I'm trying to implement a **ProgressDialog** while it parses, but I'm having considerable trouble. I've tried implementing this in many places, but this is my current setup:

        public class PointViewer extends Activity{
         ...
        	@Override
        	public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                
                Bundle extras = getIntent().getExtras();
                filePath = extras.getString("file_path");
        
                mGLView = new GLSurfaceView(this);
                theRenderer = new OpenGLRenderer();
                mGLView.setRenderer(theRenderer);
                //Parse the file and set the arrays
                theRenderer.setLAS(filePath);
                setContentView(mGLView);
        
        	}
         ...
        }

The Rendering class...

    public class OpenGLRenderer extends Activity implements GLSurfaceView.Renderer {
             ...
                public void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    
            	}
                
                public void setLAS (String fileName){
                	
                	new ProgressTask(this).execute();
                	
            
                }
            ...
            /*
             * The class for the progress dialog 
            */
            private class ProgressTask extends AsyncTask<String, Void, Boolean> {
               private ProgressDialog dialog;
               private Context context;
     
               //private List<Message> messages;
               public ProgressTask(Context ctx) {
               
                   context = ctx;
                   dialog = new ProgressDialog(context);
               }
    
    
    
               /** progress dialog to show user that the backup is processing. */
    
               protected void onPreExecute() {
                   this.dialog.setMessage("Progress start");
                   this.dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
                   this.dialog.show();
               }
    
                @Override
               protected void onPostExecute(final Boolean success) {
                
    
                   if (dialog.isShowing()) {
                       dialog.dismiss();
                   }
    
                   if (success) {
                       Toast.makeText(context, "OK", Toast.LENGTH_LONG).show();
                   } else {
                       Toast.makeText(context, "Error", Toast.LENGTH_LONG).show();
                   }
               }
    
               protected Boolean doInBackground(final String... args) {
                   try{    
                   	ptCloud = new PointCloud(args[0]);
       
                      	...
    
                       dialog.setProgress(percentParsed);
                       return true;
                    } catch (Exception e){
                       Log.e("tag", "error", e);
                       return false;
                    }
                 }
    
    
    }
       

When I call **dialog = new ProgressDialog(context);** It errors on a null pointer exception, I'm assuming because there is a context issue... Does anyone have any ideas? Thank you in advance!