Back to project page pinpoint-android.
The source code is released under:
MIT License
If you think the Android project pinpoint-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package co.islovely.pinpoint; // w ww . j av a2 s . c o m import java.util.ArrayList; import java.util.List; import java.util.Random; public class TaskManager { private List<Task> taskList; private Random random; private int homescreenId; public TaskManager(int homescreenId) { this.random = new Random(); this.taskList = new ArrayList<Task>(); this.homescreenId = homescreenId; List<LauncherItem> launcherItems = LauncherReader.getAllItemsNotInDock(MyApplication.getAppContext()); for (LauncherItem launcherItem : launcherItems) { if (launcherItem.getScreen() == homescreenId) { this.taskList.add(new Task(launcherItem, ColumnsActivity.class)); this.taskList.add(new Task(launcherItem, GridActivity.class)); this.taskList.add(new Task(launcherItem, QuadrantsActivity.class)); this.taskList.add(new Task(launcherItem, RowsActivity.class)); } } } public Task getTask() { if (!this.taskList.isEmpty()) { Task task = taskList.get(this.random.nextInt(this.taskList.size())); this.taskList.remove(task); return task; } return null; } }