延迟startActivity


  public static void StartActivity(int time, final Activity activity, final Class<? extends Activity> cls){
    Handler mHandler= new Handler();
    mHandler.postDelayed(new Runnable() {
        @Override
        public void run() {
            Intent intent = new Intent(activity, cls);
            activity.startActivity(intent);
            activity.finish();
        }
    },  time);
}

使用方法

   StartActivity(200,mContext,xxx.css);

声明:本网站采用BY-NC-SA协议进行授权

版权:LeoROM丨FusionLeo内核丨三星S9丨三星S8|版权所有,违者必究|如未注明,均为原创

转载:转载请注明原文链接 - 延迟startActivity


不忘初心 方得始终