Android ListView Refresh Single Row - Should I hide ListView from ArrayAdapter
<p>I am refering <a href="http://stackoverflow.com/questions/2123083/android-listview-refresh-single-row">Android ListView Refresh Single Row</a></p>

<p>However, to use the above link technique, I have to make <code>ListView</code> visible to <code>ArrayAdapter</code>.</p>

<p>Currently, in order to have a very optimized way to update display in <code>ListView</code>, I need to do this to my <code>ArrayAdapter</code></p>

<pre><code>public PortfolioArrayAdapter(ListView listView, Activity activity, List&lt;TransactionSummary&gt; transactionSummaries) {
    super(activity, R.layout.portfolio_management_row_layout, transactionSummaries);
    this.activity = activity;
    this.listView = listView;
    ...
}

// Do not use notifyDataSetChanged, as it will refresh entire ListView.
// We only want to update certain row.
private void refreshView(final int row) {
    final int firstVisiblePosition = listView.getFirstVisiblePosition();
    final int lastVisiblePosition = listView.getLastVisiblePosition();
    if (row &lt; firstVisiblePosition || row &gt; lastVisiblePosition) {
        return;
    }
    this.activity.runOnUiThread(new Runnable() {
        public void run() {
            final View view = listView.getChildAt(row - firstVisiblePosition);
            // Refresh?
            getView(row, view, listView);                
        }
    });
}
</code></pre>

<hr>

<p>However, I feel uncomfortable to pass <code>ListView</code> reference to <code>ArrayAdapter</code>, as I thought they should be independent from each others? (Due to MVC?)</p>

<p>Is there any better way I can let <em>ListView Refresh Single Row</em>?</p>

<p>In Java Swing, they did it in a pretty neat way. They provide the following method for a table model.</p>

<p><a href="http://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/table/AbstractTableModel.html#fireTableCellUpdated%28int,%20int%29" rel="nofollow">fireTableCellUpdated(row, col);</a></p>

<p>So, that model can tell view which row and col is being affected, without knowing who the view is.</p>

<p>In Andorid, my model (<code>ArrayAdapter</code>) needs to know, <code>ListView</code> is the view, only then my model can talk to the view.</p>
