java - Wait for a thread before continue on Android -


i've 1 thread, i'd wait finish before continue next actions. how it?

            new thread(                      new runnable() {                          @override                         public void run() {                             mensaje = getfilesfromurl(value);                         }                      }).start(); 

here i'd put (but loops) knows when thread finishes , evaluate result (mensaje)

            btnok.setvisibility(view.visible);             progressbar.setvisibility(view.gone);             lblestado.settext(mensaje);              if(mensaje.equals("importado"))                 startactivity(new intent(scanurl.this, mainactivity.class)); 

thread t = new thread(new runnable() {                         @override                         public void run() {                             mensaje = getfilesfromurl(value);                         }});  t.start(); // spawn thread  t.join();  // wait thread finish 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -