Beispiel #1
0
 /** Launches a given task. */
 public boolean launchTask(Task task) {
   Log.d(TAG, "launchTask: ");
   // Get the first stack view
   List<TaskStackView> stackViews = getTaskStackViews();
   int stackCount = stackViews.size();
   for (int i = 0; i < stackCount; i++) {
     TaskStackView stackView = stackViews.get(i);
     TaskStack stack = stackView.getStack();
     // Iterate the stack views and try and find the given task.
     List<TaskView> taskViews = stackView.getTaskViews();
     int taskViewCount = taskViews.size();
     for (int j = 0; j < taskViewCount; j++) {
       TaskView tv = taskViews.get(j);
       if (tv.getTask() == task) {
         onTaskViewClicked(stackView, tv, stack, task, false);
         return true;
       }
     }
   }
   return false;
 }