Handler相關------方法,更新UI,非同步,解決資料載入量等

風的王子發表於2013-11-21

Handler的更新UI
new Handler().postDelayed(Runable,delaytime);

延遲intent跳轉,一般用於閃屏,loading介面,或者延遲一段時間傳送訊息

Runnable r = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
startGoPage();
}
};
new Handler().postDelayed(r, 2000);
------------------------
startGoPage(){
Inent intent = new Inent(xx.this,xxx.class);
startActivity(intent);
finish();

相關文章