I'm having trouble changing data organized within a textView inside the list view. I can access the data and send a toast of text, but when I change it the list is not updated.
Crate on Public Zero (Bundle Saved Instantstate) {super.onCreate (savedInstanceState); SetListAdapter (new array adapter & lt; string & gt; (this, android.R.layout.simple_list_item_1, President)); ListView lv = getListView (); Lv.setTextFilterEnabled (true); ListAdapter list_adapter = lv.getAdapter (); TextView var_x = (TextView) list_adapter.getView (0, empty, empty); List view list = getListView (); Int count = list.getChildCount (); Toast.makeText (getApplicationContext (), (var_x) .getText (), Toast.LENGTH_SHORT) .show (); Var_x.setText ("not president"); }
Once I've already made it, how can I change the text / style of a line?
Thanks for any help
Try it out:
< P> adapter = new array adapter (this, android.R.layout.simple_list_item_1, presidents) setListAdapter (adapter);// Make changes to the list
adapter.notifyDataSetChanged (); // refresh
Comments
Post a Comment