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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:04:52+00:00 2026-06-05T10:04:52+00:00

So here is how it is : I have an AsyncTask with a TimerTask.

  • 0

So here is how it is :

I have an AsyncTask with a TimerTask. Every 15 seconds the AsyncTask is run.
The AsyncTask gets XML data and put those in dynamically created TextView contained in dynamically create TableRow.

onPostExecute i create all my tableRow and TextView and then in order to not have them double instead of refresh i remove the tableRow views.

protected void onPostExecute(Document result)
{
if(TableLayout.getChildAt(1) == null)
{
    //All my code to show tableRow and TextView
else
{
    int u = 20;
    while(tl.getChildAt(1) != null)
    {
        if(tl.getChildAt(u) != null)
            tl.removeViewAt(u);
        u--;
    }
}

So yeah everything works just fine. I just want to know if there is some way to ask my TimerTask to restart right away instead of waiting x millis sec for timerTask so start again?

Thanks for your help!

  • 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-05T10:04:53+00:00Added an answer on June 5, 2026 at 10:04 am

    So yeah i found out a way to do this. I’ll post in case someone else wants to do something like that.

    protected void onPostExecute(Document result)
        {
    
            if(tl.getChildAt(1) == null)
            {
                //do some code              
            }
            else
            {
                int u = 20;
                while(tl.getChildAt(1) != null)
                {
                    if(tl.getChildAt(u) != null)
                        tl.removeViewAt(u);
                    u--;
                    }
                    //do same code over again as above.
    
                    }
                }
            }
    

    This will delete the tableRows and recreate new ones thus “updating” them

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

Sidebar

Related Questions

I have created an AsyncTask that loads data from a website then when I
From here I have seen it suggested that an instance of RichTextBox be created
I have one data connection in webservice. In Assynctask i get data every 5
I have an asynctask that reads data from a device and then I want
I have an AsyncTask that fetches some data and then updates the UI with
I parse XML data and put it into an object. This takes fairly long
I'm using using AsyncTask to download data over internet and I have a little
I have to load XML data in my app, I'm doing that in a
Here I have a password field: /*********************PASSWORD**********************/ $password = new Zend_Form_Element_Password('password'); $alnumValidator = new
Here I have an arbitrary IEnumerable<T> . And I'd like to page it using

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.