Emre A. Yavuz wrote:
> Sorry about the late response.
>  
> Here's what I meant by the potential casting problem;
>  
> In order to add the ImageView variable, which was created to handle the
> Drawable resource, you need to cast the parent layout, which is of type
> ImageView, to ViewGroup type if you're planning to use the addView() method.

You cannot add an ImageView to an ImageView. ImageView is not a
container and, therefore, is not a ViewGroup. You can only add Views
(e.g., ImageView) to a ViewGroup (e.g., LinearLayout).

However, I cannot imagine a GUI design that would require an ImageView
hold another ImageView. For example, if your goal is to replace an image
in an ImageView, you can just call setImageResource() on the ImageView
you already have, rather than try adding a new one.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to