I have an Asynctask which is inside of an activity task. When I try to create a new view inside of the Asynctask it gives me an error and says its undefined. Here is what my code basically is.
public class DashboardActivity extends Activity {
class loadComments extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected void onProgressUpdate(String... values) {
super.onProgressUpdate(values);
}
@Override
protected String doInBackground(String... params) {
LinearLayout commentBox = new LinearLayout(this);
return null;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
}
}// end asynctask
}//end activity
The error occurs when I try to make the linearLayout or any type of view. I have tried taking away the (this) statement and placing the code everywhere.