top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to call a Java class from a background thread

+3 votes
370 views

I need to call this class from a background thread.

ChartPenData.main(arguments);

How can I do that?

Thread thread = new Thread();
thread = ChartPenData.main(arguments);
thread.run();
posted Apr 20, 2016 by Karthick.c

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Instead of creating thread from Class you can do this,

Thread myThread = new Thread() {
   public void run() {
      ChartPenData.main(arguments);
   }
};
myThread.start();
answer May 23, 2016 by Vinod Kumar K V
...