Execute function after 5 seconds in Android

后端 未结 9 1019
既然无缘
既然无缘 2020-12-13 12:39

I am new in android development and now my launcher activity show only 5 seconds and after that I want to check the user is logged in or not function and perform the actions

9条回答
  •  盖世英雄少女心
    2020-12-13 13:20

    long delay = 1000;
    long period = 50000;
    Timer task = new Timer();
    task.scheduleAtFixedRate(new TimerTask() {
        @Override
        public void run() {
            getDriver(sessionManager.getKEY(), ride_id);
        }
    }, delay, period);
    

提交回复
热议问题