@Override protected Label doInBackground(LabelAddRequest... requests) { if (requests == null || requests.length != 1) { throw new IllegalArgumentException("Add task supports only single Label additions."); } mRequest = requests[0]; LogUtils.log( this, Log.VERBOSE, "Spawning new LabelAddTask(%d) for %s", hashCode(), mRequest.getLabel()); return mClient.insertLabel(mRequest.getLabel()); }
@Override protected void onPostExecute(Label result) { LogUtils.log( this, Log.VERBOSE, "LabelAddTask(%d) complete, stored as %s", hashCode(), result); mRequest.invokeCallback(result); if (result != null) { sendCacheRefreshIntent(result.getPackageName()); } super.onPostExecute(result); }