@@ -0,0 +1,1564 @@
+package com.javis.android.util;%0A%0Aimport java.util.Timer;%0Aimport java.util.TimerTask;%0A%0Aimport android.os.Handler;%0Aimport android.os.Message;%0A%0A/**%0A * %E4%BD%BF%E7%94%A8%E5%9C%A8%E7%AD%89%E5%BE%85%E6%99%82%E9%96%93%EF%BC%8C%E5%8F%AA%E8%A6%81%E8%A8%AD%E7%BD%AEsetOnTimeoutListener%EF%BC%8C%E4%B8%A6%E4%B8%94%E5%9C%A8onTimeout%E9%9C%80%E5%9F%B7%E8%A1%8C%E7%9A%84%E5%91%BD%E4%BB%A4%E4%BE%BF%E5%8F%AF.%0A */%0Apublic class waitTask%7B%0A%09private int sec=1000;%0A%09public waitTask()%7B%7D%0A%09private OnTimeoutListener mOnTimeoutListener;%0A%09public interface OnTimeoutListener%7B%0A        void onTimeout();%0A    %7D%0A%09public void setOnTimeoutListener(OnTimeoutListener l)%7B%0A%09%09mOnTimeoutListener = l;%0A    %7D%0A%0A%09public class waitRun extends TimerTask%7B %0A%09%09public Timer time;%0A%09%09@Override%0A%09%09public void run() %7B%0A%09%09%09// TODO Auto-generated method stub%0A%09%09%09time.cancel();%0A%09%09%09sendMsg(0);%0A%09%7D%7D;%0A%0A    public void setTimeout(OnTimeoutListener onTimeoutListener, int sec)%7B%0A    %09setOnTimeoutListener(onTimeoutListener);%0A    %09waitRun waitrun = new waitRun();%0A    %09Timer timer = new Timer();%0A    %09waitrun.time=timer;%0A%09%09timer.schedule(waitrun, sec);%0A    %7D%0A    public void setTimeout(OnTimeoutListener onTimeoutListener)%7B%0A    %09setOnTimeoutListener(onTimeoutListener);%0A    %09waitRun waitrun = new waitRun();%0A    %09Timer timer = new Timer();%0A    %09waitrun.time=timer;%0A%09%09timer.schedule(waitrun, sec);%0A    %7D%0A    %0A    private Handler handler = new Handler()%7B%0A%09    @Override%0A%09    public void handleMessage(Message msg)%7B%09//%E5%AE%9A%E7%BE%A9%E4%B8%80%E5%80%8BHandler%EF%BC%8C%E7%94%A8%E6%96%BC%E8%99%95%E7%90%86%E4%B8%8B%E8%BC%89%E7%B7%9A%E7%A8%8B%E8%88%87UI%E9%96%93%E9%80%9A%E8%A8%8A%0A%09        if (!Thread.currentThread().isInterrupted())%7B%0A%09        %09mOnTimeoutListener.onTimeout();%0A%09        %7D%0A%09    super.handleMessage(msg);%0A%09    %7D%0A%09%7D;%0A%09private void sendMsg(int flag)%7B%0A%09    Message msg = new Message();%0A%09    msg.what = flag;%0A%09    handler.sendMessage(msg);%0A%09%7D%0A%7D%0A

Create waitTask.java