something weird is happening when i inflate a particular view and i
wonder whether i'm running into some kind of namespace collision
inside the resource/class space.
i have a few custom views in my app and generally i park them in
discrete XML files. the views are declared --
// myview.xml
<?xml version="blah.... ?>
<com.mydomain.MyView
xmlns=...
>
<!-- subview stuff in here -->
<LinearLayout....>
</com.mydomain.MyView>
i then cast the return of inflate() appropriately in code --
MyView view = (MyView) inflater.inflate (R.layout.myview, parent, true);
-- and then the class itself usually extends LinearLayout
// MyView.java
public class MyView
extends LinearLayout
{
// ...
}
this generally works fine. the views are pretty much implemented
identically. however, with one of these views i'm seeing that the
type coming back is LinearLayout rather than MyView. eh? i changed
the name of the view to something ridiculous and confirmed that the
inflater would blow up on an unfound class. so i know it's looking at
the class name -- but not instantiating the class (the constructor
never gets called).
i dumped out some stuff about the LinearLayout that is coming back
from the inflater and from the child count etc seems like the *first
child* of the custom view.
under what circumstances would the inflater bring back the child of
the specified view and not the view itself? weird that it only
happens with some views.
thanks in advance
--
jason.vp.engineering.particle
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---