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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:05:36+00:00 2026-06-11T10:05:36+00:00

My main Thread extends from Activity , it starts two asynchronous tasks that gather

  • 0

My main Thread extends from Activity, it starts two asynchronous tasks that gather data from different UDP sources. One of this tasks should append the data to this graph drawing library. I am making updates on the UI from the onPostExecute section of AsynTask:

@Override
protected void onPostExecute(Integer result) {
    super.onPostExecute(result);
    edt2.setText(Integer.toString(result));
    // Graph Update
    if (graphActive) {
        exampleSeries1.appendData(ATList.get(ATList.size()-1), true);
    } else {
        //do nothing
    }
}

The data is passed to the graph and if I click with my finger on the display it is displayed correctly, but I want the software to update the graph automatically. The edt2 textfield is updated automatically.

I tried the following:

layout.postInvalidate(); //and invalidate

I have no idea how to make Android to update the GraphView.

This is the respective part of the XML:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/graph1"
    android:layout_width="match_parent"
    android:layout_height="305dp" >

</LinearLayout>

Thank you very much 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-11T10:05:37+00:00Added an answer on June 11, 2026 at 10:05 am

    AsyncTask is not a Ui Thread use runOnUiThread(..) instead Asynctask.

    1 rl-: parent view.
    2 myView -: Child View

    //Use This Method //

        runOnUiThread(new Runnable() {
    
            //@Override
            public void run() {
                // TODO Auto-generated method stub
                rl.addView(new myView(getApplicationContext()));
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main thread that invokes a child thread function at different times
I have code that reloads images via HTTP from the main thread and displays
In my Main Activity, I have a Thread that is doing alot of stuff,
I have a class class with main thread public class MainThread extends Thread {
Apart from main thread, I've ThinkerThread object _thinker whose finished() signal is connected to
I have the main thread from which I start a window using invokeLater .
I have a windows form on the main thread and another thread that does
I want to create a worker thread that isn't the main thread so I
My main application does this: It retrievs data from the internet and has 3
I have a main activity that launches a child activity using the following code:

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.