Sunday, June 10, 2012

[android-developers] XML vs. setImageDrawable after setContentView()

Hello,

If I set the src attribute of an ImageView in the layout XML, it will
know the image *before* setContentView(R.layout.main) is called.

If I omit the src attribute, because the image is preloaded
programmatically, then I can only call
mImageViewDrawable.setImageDrawable or setImageBitmap *after*
setContentView() is called.

Is the result the same? Or since the image is set *after*
setContentView(), are some Android scaling/etc. skipped because of
this (which are normally performed when the resource is specified in
XML) ?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment