Hello Blake,

Thank you for your reply! I really appreciate it.
It looks like I didn't give enough details on my problem, so here is some 
more information. As I already mentioned, we have the following inheritance 
chain:

CustomListView <- ListView <- AbsListView <- AdapterView<T> <- ViewGroup <- 
> ...
>

In my CustomListView class I've overrode protected void layoutChildren() 
{...}. From that overridden method I'm calling super.layoutChildren(). 
After that there is a chain of internal calls within ListView class:

layoutChildren() -> fillFromTop() -> fillDown() -> makeAndAddView() -> 
> obtainView()
>

obtainView() method is defined in AbsListView class and has a default 
access modifier, thus I have NO ability to override it, as my 
CustomListView class belongs to the different package. As a result, I can 
only hide it, if I'll define obtainView() method with the same signature. 
The thing is that my method SHOULD NOT be called from makeAndAddView() 
method of the ListView class, obtainView() which belongs to the AbsListView 
class should be utilized instead. But my tests show that obtainView() from 
my CustomListView class is called, which is not correct. If I do not define 
obtainView(), call chain looks as follows:

... -> makeAndAddView() -> obtainView() -> setupChild() -> 
> attachViewToParent() OR addViewInLayout()
>

Both attachViewToParent() and addViewInLayout() are defined in the 
ViewGroup class and have "protected" access modifiers, thus I SHOULD have 
an ability to override them. BUT if I define this methods in my 
CustomListView class, attachViewToParent() or addViewInLayout() of the 
ViewGroup class are called instead, which is also incorrect.

Here are the sources of:

ListView.java - 
http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/android/widget/ListView.java/?v=source
AbsListView.java - 
http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/android/widget/AbsListView.java/?v=source
ViewGroup.java - 
http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/android/view/ViewGroup.java/?v=source

I would really appreciate the insight of such guru as you. Thank you again 
for you time!

Have a nice day!
Alex

-- 
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

Reply via email to