notifyDataSetChanged does NOT force adapter to call sequence of getView method instantly. It rather tells that it should be refreshed and it happens asynchronously. If you want to achieve that goal you mentioned I have 2 ideas:
- Add
bu_language_change Button
to your view fromDEFAULT_LINE
with visibility levelView.GONE
then in yourEDIT_LINE
you change visibilityView.VISIBLE
.View.GONE
makes your layout to behave as it has no such child(bu_language_change Button). - Somehow notify from getView() method that inflating view has been done, and call
editLanguage
method. But it's a bad idea.Romain Guy
in here says:
... getView() is not guaranteed to be called exactly once per item ...
Or call this editLanguage
method from the body of getView
method, that would have solved your problem.
I recommend to watch Google I/O about ListViews. It's over here