I need to remove the line where a button was clicked from a listadapter. Preferably from within the method getView. As I do this?
I have a screen like the image below.
http://img146.imageshack.us/img146/1452/explicacao.jpg
It got a TabHost Tab2 and I have a setAdapter that carries a list, within this list I have another setAdapter which has another list, as shown. need, when you press the button (Remove) this line is removed, giving place to the bottom line, that is the bottom line up .. I managed to do this usarno view.setVisibility (View.INVISIBLE), the line disappears, but the space is still there.
It would be interesting to do this inside the method getView () that list that have the item removed.
What I am doing is asking if the getView (...) in the ArrayList object.remove == true I do
view.setVisibility (View.INVISIBLE)
if not I return view;
More like this:
view = convertView;
if (view == null) {
LayoutInflater infl开发者_开发技巧ater = (LayoutInflater) context.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate
(R.layout.lista_linhas_fiscalizacao, null);
}
if (object.remove == false) {
Do something ... else {}
view.setVisibility (View.INVISIBLE);
}
Any ideas?
Thank you.
moment when you want do this... call yourAdapter.notifyDataSetChanged()
this method,,.. it refreshes your list
精彩评论