android - why views do not appear when we use thread -


protected void oncreate(bundle savedinstancestate) {     // todo auto-generated method stub     super.oncreate(savedinstancestate);     this.requestwindowfeature(window.feature_no_title);     setcontentview(r.layout.activity_welcome);      new thread(new btthread()).start(); } 

in btthread, there public void run() method thread.sleep(3000)first , jump activity. during first activity time, cannot see content of activity_welcome. if ideas this, appreciate have help.

you can't start new activity on thread other main thread.

if btthread inner class of activity can call

runonuithread(new runnable() {     public void run() {         //startactivity     } }); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -