arg... you didn't understand me or i can't understand you

getChildView and getGroupView are from the ExpandableListView, but we are 
talking about the Adapter,

i dont know how to update only the view of only the two childs i want to 
update, please, can you give me code example of what you want to say to me? 
i can't understand

El viernes, 1 de febrero de 2013 13:08:36 UTC+1, Kostya Vasilyev escribió:
>
> Urm, for an expandable list view -- getChildView or getGroupView.
>
> -- K
>
> 2013/2/1 saex <elpab...@gmail.com <javascript:>>
>
>> i didn't understand you, the adapter doesn't have a getView method
>>
>> El viernes, 1 de febrero de 2013 12:50:46 UTC+1, Kostya Vasilyev escribió:
>>>
>>> Is that it?
>>>
>>> >> 
>>>
>>> You could call the adapter's getView, making sure to pass the existing 
>>> view as the "convertView".
>>>
>>> <<
>>>
>>> -- K
>>>
>>> 2013/2/1 saex <elpab...@gmail.com>
>>>
>>> i know how to get the views, the problems is that i can't reach the way 
>>>> to tell the adapter to update the content of only these views... did you 
>>>> know?
>>>>
>>>> thanks
>>>>
>>>> El viernes, 1 de febrero de 2013 12:37:51 UTC+1, Kostya Vasilyev 
>>>> escribió:
>>>>>
>>>>> Might look something like this:
>>>>>
>>>>> final int nFirst = mAccountListView.**getFirstVisib**lePosition();
>>>>> final int nLast = mAccountListView.**getLastVisibl**ePosition();
>>>>>  for (int position = nFirst; position <= nLast; ++position) {
>>>>>
>>>>> View itemView = mAccountListView.getChildAt(**po**sition - nFirst);
>>>>>
>>>>> As for asking the adapter to update the view, well, there isn't a 
>>>>> direct way to do this. You could call the adapter's getView, making sure 
>>>>> to 
>>>>> pass the existing view as the "convertView".
>>>>>
>>>>> Or just "reach into" the content of your item layout (findViewById, 
>>>>> ViewHolder) and update the values.
>>>>>
>>>>> If the number of items in the adapter can change dynamically, it gets 
>>>>> more complicated, as the list view can be out of sync with the adapter.
>>>>>
>>>>> And remember, this can be considered an ugly hack that violates the 
>>>>> holy principles of Objectively Orientated Progammation (or whatever that 
>>>>> thing is called) :)  -- but can be useful where performance is important.
>>>>>
>>>>> -- K
>>>>>
>>>>> 2013/2/1 saex <elpab...@gmail.com>
>>>>>
>>>>> OK, i can get the childs View with:
>>>>>>
>>>>>> el.getChildAt(1);
>>>>>> el.getChildAt(2);
>>>>>>
>>>>>> but... what shouild i do to notify these views that they must reload 
>>>>>> their content from the adapter?
>>>>>>
>>>>>> El viernes, 1 de febrero de 2013 11:38:42 UTC+1, Kostya Vasilyev 
>>>>>> escribió:
>>>>>>>
>>>>>>> While TreKing's advice to profile is of course excellent...
>>>>>>>
>>>>>>> ...rebuilding the entire {expandable} list view just to update one 
>>>>>>> item is more work that necessary.
>>>>>>>
>>>>>>> When performance is important, you can walk the list of visible item 
>>>>>>> views, find the one you need to update, and do it right there. You will 
>>>>>>> want to use listView.getFirstVisibleItem / getLastVisibleItem / 
>>>>>>> getChild.
>>>>>>>
>>>>>>> Also there is a callback, AbsListView.onScrollListener, which lets 
>>>>>>> you know when the list view is scrolling, and perhaps suspend your 
>>>>>>> updates 
>>>>>>> if necessary.
>>>>>>>
>>>>>>> -- K
>>>>>>>
>>>>>>> 2013/2/1 saex <elpab...@gmail.com>
>>>>>>>
>>>>>>>>  I have a ExpandableListView with some groups, and each group 
>>>>>>>> haves only one child, with a string on it.
>>>>>>>>
>>>>>>>> I have a thread that get's some updated data and *each second*calls a 
>>>>>>>> handler that updates the string of one of the childs of the 
>>>>>>>> ExpandableListView and then calls this method to refresh the view and 
>>>>>>>> show 
>>>>>>>> the updated data to the user: ((BaseExpandableListAdapter) 
>>>>>>>> mAdapter).**notifyDataSetChanged****();
>>>>>>>>
>>>>>>>> This is the update handler:
>>>>>>>>
>>>>>>>> infoUpdateHandler = new Handler(){
>>>>>>>>             @Override
>>>>>>>>             public void handleMessage(Message msg) {
>>>>>>>>                 super.handleMessage(msg);   
>>>>>>>>                 children[2][0]=getUpdatedInfo(******);
>>>>>>>>                 ((BaseExpandableListAdapter) 
>>>>>>>> mAdapter).notifyDataSetChanged******();
>>>>>>>>             }
>>>>>>>>         };
>>>>>>>>
>>>>>>>> The problem is that when i'm scrolling the expandable list view, i 
>>>>>>>> can see how the scroll is showing low performance, it stops sometimes. 
>>>>>>>> I 
>>>>>>>> think that it is because this call ((BaseExpandableListAdapter) 
>>>>>>>> mAdapter).**notifyDataSetChanged****(); is updating all the 
>>>>>>>> ExpandableListView. 
>>>>>>>>
>>>>>>>> *Does not exist a better way to update a expandable list view? 
>>>>>>>> Maybe a way to update only the child that you want to update?*
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>  
>>>>>>>> -- 
>>>>>>>> -- 
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "Android Developers" group.
>>>>>>>> To post to this group, send email to android-d...@**
>>>>>>>> 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<http://groups.google.com/group/android-developers?hl=en>
>>>>>>>> --- 
>>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>>> Groups "Android Developers" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>>> send an email to android-developers+**unsubscribe****
>>>>>>>> @googlegroups.com.
>>>>>>>> For more options, visit https://groups.google.com/**grou****
>>>>>>>> ps/opt_out <https://groups.google.com/groups/opt_out>.
>>>>>>>>  
>>>>>>>>  
>>>>>>>>
>>>>>>>
>>>>>>>  -- 
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Android Developers" group.
>>>>>> To post to this group, send email to android-d...@**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<http://groups.google.com/group/android-developers?hl=en>
>>>>>> --- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Android Developers" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to android-developers+**unsubscribe**@googlegroups.com.
>>>>>> For more options, visit 
>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>> .
>>>>>>  
>>>>>>  
>>>>>>
>>>>>
>>>>>  -- 
>>>> -- 
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Developers" group.
>>>> To post to this group, send email to android-d...@**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<http://groups.google.com/group/android-developers?hl=en>
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Android Developers" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to android-developers+**unsubscr...@googlegroups.com.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>  
>>>>  
>>>>
>>>
>>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> android-d...@googlegroups.com<javascript:>
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-developers+unsubscr...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to