While you're updating the content of the text view here, you're not updating the data that backs the adapter for your list view. This means when your activity comes back into view (after the second startActivityForResult
) it's redrawing itself with the old data.
Instead of updating the view directly, you should update the data that backs the adapter. Something like this; you'll have to modify it to suit your code.
if (requestCode == 1 && resultCode == RESULT_OK) {
List<Integer> adapterData = listViewAdapter.getQuantities();
int quantity = adapterData.get(selectedIndex) + 1;
adapterData.set(selectedIndex, quantity);
listViewAdapter.setQuantities(adapterData);
Intent intent = new Intent();
intent.setClass(getApplicationContext(), NotificationActivity.class);
intent.putExtra("Value1", "0");
startActivityForResult(intent, 100);
}
And in your adapter, you'd have something like this:
public List<Integer> getQuantities() {
return mQuantities;
}
public void setQuantities(List<Integer> quantities) {
mQuantities = quantities;
notifyDataSetChanged();
}