Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:30:07+00:00 2026-06-09T00:30:07+00:00

I am refering Android ListView Refresh Single Row However, to use the above link

  • 0

I am refering Android ListView Refresh Single Row

However, to use the above link technique, I have to make ListView visible to ArrayAdapter.

Currently, in order to have a very optimized way to update display in ListView, I need to do this to my ArrayAdapter

public PortfolioArrayAdapter(ListView listView, Activity activity, List<TransactionSummary> 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 < firstVisiblePosition || row > lastVisiblePosition) {
        return;
    }
    this.activity.runOnUiThread(new Runnable() {
        public void run() {
            final View view = listView.getChildAt(row - firstVisiblePosition);
            // Refresh?
            getView(row, view, listView);                
        }
    });
}

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

Is there any better way I can let ListView Refresh Single Row?

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

fireTableCellUpdated(row, col);

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

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:30:09+00:00Added an answer on June 9, 2026 at 12:30 am

    I’m not sure why you think your ArrayAdapter shouldn’t be able to have a reference to your ListView. ListView is your View and ArrayAdapter your Model, so they need to interact. From wikipedia:

    A model notifies its associated views and controllers when there has
    been a change in its state. This notification allows the views to
    produce updated output, and the controllers to change the available
    set of commands

    Isn’t this exactly how the principle of listeners work, you add the view to a list of listening objects and notify them on any change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 questions to ask here. I am refering http://www.broculos.net/en/article/android-101-how-create-stackview-widget to create a
I have tried to do this refering to following link. http://skypher.com/index.php/2008/07/28/function-list-for-php/ But no success.
I am refering to http://developer.android.com/reference/android/app/Activity.html . I have an activity which can be interrupted
I have a listview say in this instance has the values: UK, USA, FRANCE
Once I have created a project with the Android wizard, how do I change
I have an Android project that loads a custom .so lib. I'm having trouble
I have a FrameLayout as follows (both android:src attributes refer to .png files in
I'm trying to launch the Android tethering settings menu from within a program, however
If you have an app posted on Android Market, which isn't free, so the
Refering to http://www.devx.com/tips/Tip/13291 , it says that I can use memcpy with the size

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.