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:
- using
asynctask - using
runonuithread()
you can read this article on threading in android understand concept better.
Comments
Post a Comment