Skip to content

Commit

Permalink
新增延时任务方法
Browse files Browse the repository at this point in the history
  • Loading branch information
秋逸 committed Jan 3, 2017
1 parent a9d060d commit 62ffe35
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions VonTools/src/main/java/com/vondear/vontools/VonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
Expand Down Expand Up @@ -40,6 +41,21 @@ public static void init(Context context) {
VonCrashUtils.getInstance(context).init();
}

//----------------------------------------------------------------------------------------------延时任务封装 start
public interface DelayListener {
void doSomething();
}

public static void delayToDo(final DelayListener delayListener,long delayTime) {
new Handler().postDelayed(new Runnable() {
public void run() {
//execute the task
delayListener.doSomething();
}
}, delayTime);
}
//==============================================================================================延时任务封装 end

/**
* 获取ApplicationContext
*
Expand Down

0 comments on commit 62ffe35

Please sign in to comment.