I am trying to update a String in a ListView, and have the update be reflected in the ListView. Here are the basics of what's going on:
testStrings = {"String", "String", String"};
ListView l = (ListView) findViewById( R.id.listView1 );
ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.simple_list_item_1, testStrings);
l.setAdapter(adapter);
Later, testStrings is update like so:
testStrings[1] = "new string";
Note, just the text is changing, not the cardinality of the String array.
On a Samsung Galaxy Nexus with Android 4.3, the text in the ListView is updated as expected, with no additional calls to the adapter.
On a Google Nexus 7 running Android 4.4.2, nothing happens. On the Nexus 7, I've tried calling notifyDataSetChanged(); on the adapter, and that doesn't do anything either.
I've seen a number of questions about ListViews not updating, but those examples seem to be doing something more complicated than what I'm trying to do. Why is one device working fine, but not the other? How do I get the ListView on the Nexus 7 updating correctly?