Viv*_*art 6

试试这个

// Get the current application descriptor.
ApplicationDescriptor current = ApplicationDescriptor
                        .currentApplicationDescriptor();

// Schedules are rounded to the nearest minute so ensure the
// application is scheduled for at least 1 minute in the future.
ApplicationManager.getApplicationManager().scheduleApplication(
                        current, System.currentTimeMillis() + 60001, true);
Run Code Online (Sandbox Code Playgroud)

有关更多详细信息,您还可以阅读本文. 安排应用程序在特定时间运行