Question

I don't understand why I'm receiving a ClassCastException when I use this line:

Activity a=(Activity)photoToLoad.imageView.getContext();

That is taken from the LazyList example (the second answer) and in that project it works, but when I use the class in mine, it doesn't work. It is necessary to obtain an Activity to use the runOnUIThread method to set the downloaded Bitmap to the ImageView and avoid handlers. What am I doing wrong?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top