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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:54:30+00:00 2026-06-13T05:54:30+00:00

I have a thread inside an invokeLater method in Blackberry like: startButton.setChangeListener(new FieldChangeListener() {

  • 0

I have a thread inside an invokeLater method in Blackberry like:

startButton.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field arg0, int arg1) {
    UiApplication.getUiApplication().invokeLater(new Runnable() {
        public void run() {
            Thread thread = new Thread(){
                public void run() {
                    uploadFile();
                }
            };
            thread.start();
        }
    });
}

I have a thread because I want to run that function in the background and want to be able to do other stuff while its doing its job. What I am wondering is if this is a good approach. Do I really need the invokeLater in this case ?

  • 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-13T05:54:31+00:00Added an answer on June 13, 2026 at 5:54 am

    Short answer: no.

    Long answer:

    InvokeLater puts the Runnable on the event queue so that, in time, when the event loop sees the Runnable it will execute it on the event thread. Since you are calling invokeLater in the fieldChanged method of a FieldChangeListener, you are calling it from the event thread. Unless what you want to do is delay the start of your thread to some unknown later time then no you don’t need to use invokeLater.

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

Sidebar

Related Questions

I have a thread called checkUpdate inside this method: public void onLocationChanged(Location location) checkUpdate
I have a thread implemented inside a class using runnable like this: static Runnable
I have a requirement to embed a thread inside a C++ class, kind of
I have this code inside thread and when I call terminate it terminates fast
I have wince 6.0 applcaion in which inside thread applcation is waiting for event
I have a thread inside an Activity. Is the thread killed by the system
I have a thread, A , which performs periodic actions inside a while(running) loop.
I have a Thread that starts in my main form private void changePasswordbutton_Click_1(object sender,
So I have the following thread: public class MyThread extends Thread { Handler cHandler;
Hy!! I have a thread class and want to set a timeout inside after

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.