i have implemented a Runnable interface to load the image tiles and i want to call the Main thread from this secondary thread for displaying the tiles.
can anybody tell me how to call a Main thread from a Runnable Interface thread in Java.
thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Instead of
Runnableyou can useCallable<Set<Image>>which returns a set of loaded images. Submit this callable task to an executor, get theFuture<Set<Image>>and wait for the loading thread to finish its job.For example: