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 8683255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:59:28+00:00 2026-06-12T21:59:28+00:00

I have a Custom ListView in my application, containing an ImageView and 3-5 TextViews.

  • 0

I have a Custom ListView in my application, containing an ImageView and 3-5 TextViews.

1 of the TextViews shows the time gap between the current time and the time specified for that ListView item.

Like: Posted 5 minutes ago

The question is, how can i update this TextView every minute without any disturbance to the ListView.

Like: if i am looking at the ListView for 5 minutes, just this TextView alone must change from 1 min to 2 mins so on for every item visible

What i tried:

  1. set this TextView in getView() using System.currentTimeMillis() - givenTime[position];

but here the TextView won’t get updated if i am not scrolling (not calling the getView) or changing the visibility of the items.

  1. Use a timeTask() thread every 1 minute and try to update the TextView of every item

here the problem is i get an Exception:

android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

moreover i have no idea how to change the TextView for every ListView item from the Activity.

But this looks like a familiar case.

How can i achieve this?

Thank You

  • 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-12T21:59:29+00:00Added an answer on June 12, 2026 at 9:59 pm

    Use a Handler and its postDelayed method to invalidate the list’s adapter as follows:

    final Handler handler = new Handler()
    handler.postDelayed( new Runnable() {
    
        @Override
        public void run() {
            adapter.notifyDataSetChanged();
            handler.postDelayed( this, 60 * 1000 );
        }
    }, 60 * 1000 );
    

    You must only update UI in the main (UI) thread.

    By creating the handler in the main thread, you ensure that everything you post to the handler is run in the main thread also.

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

Sidebar

Related Questions

In my application, i have a ListView with a Custom adapter containing data like
I have used custom listview and custom rating bar. If I add that custom
I have a Custom ListView which has an ImageView and a TextView. and i
Here's my aproach: I have a custom ListView containing a custom Adapter containing two
I support a .Net 2.0 Windows application that has a custom listview control to
In android application i have a custom listview and sqlite database. I want to
I have created one custom list view item for my application. Suppose for any
I have created a custom listview that have one webview per element. My problem
I have a custom ArrayAdapter for a listView in an adroid chat application. I
I have an application that displays a ListView using a CursorAdapter that I have

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.