android - Changing image in imageview using Threads -


i'm getting error code. why huhu 123123123

thread timer = new thread() {     public void run()     {         try         {             sleep(1500);             splash.setimgeresource(r.drawable.dilclogo);             sleep(1500);         }         catch (interruptedexception e)         {             e.printstacktrace();         }                 {             intent intent = new intent(mainactivity.this, menuscreen.class);             startactivity(intent);         }     } }; timer.start(); 

this because can not access ui/main thread directly other thread. can use below methods access ui thread though:

  1. using asynctask
  2. using runonuithread()

you can read this article on threading in android understand concept better.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -