The problem is on the:
new ScreenSlideActivity().new DownloadImagesTask()
As you can see you're creating a new ScreenSlideActivity and the AsyncTask belongs to this new one, instead of the current one being executed, which has inflated the layout and where the 'findById' works. Because you're using the AsyncTask created on the instance of the new instance, the code inside the AsyncTask.onPostExecute() will fail badly:
ImageView mChart = (ImageView) findViewById(R.id.imageView1);
Why? because the findViewById() can't be executed because you're created the Activity instance by yourself, not managed by Android..so it's lost.
So instead of using this approach...try to delegate the onItemClick execution to a method inside the current running Activity instance..like this:
listview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
String selectedPonyURL=listurl.get(position);
((ScreenSlideActivity)getActivity()).handleOnItemClick(selectedPonyURL);
}
});
and inside you will put the handling of starting the AsyncTask within the same context...like this you won't be creating a new ScreenSlideActivity object, you will be reusing the existing one...in ScreenSlideActivity:
...
public void handleOnItemClick(String selectedPonyURL) {
new DownloadImagesTask().execute(selectedPonyURL);
}
...
Note: NEVER instantiate an Activity, its creation is managed by Android, if you do that, it will be just like a plain Java object, but problematic.