From e1032fa194fbb9117b511e17f9cac60d61fd11f1 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 1 Oct 2009 19:51:14 -0700 Subject: [PATCH] Dismiss FastTrack only after calling startActivity(). When launching towards an existing task where the target activity is already at the top of that task, we triggered a check in ActivityManager that requires the caller to be in the foreground. Before this change, we dismissed the dialog before calling startActivity(), meaning that in this case the user action would result in a no-op. Fixes http://b/2162031 --- .../android/contacts/ui/QuickContactWindow.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/com/android/contacts/ui/QuickContactWindow.java b/src/com/android/contacts/ui/QuickContactWindow.java index 756dd1e..747c204 100644 --- a/src/com/android/contacts/ui/QuickContactWindow.java +++ b/src/com/android/contacts/ui/QuickContactWindow.java @@ -1328,28 +1328,28 @@ public class QuickContactWindow implements Window.Callback, final CheckableImageView actionView = isActionView ? (CheckableImageView)view : null; final Object tag = view.getTag(); if (tag instanceof Action) { - // Hide the resolution list, if present - setResolveVisible(false, actionView); - this.dismiss(); + // Incoming tag is concrete intent, so try launching + final Action action = (Action)tag; try { - // Incoming tag is concrete intent, so try launching - final Action action = (Action)tag; mContext.startActivity(action.getIntent()); - - if (mMakePrimary) { - ContentValues values = new ContentValues(1); - values.put(Data.IS_SUPER_PRIMARY, 1); - final Uri dataUri = action.getDataUri(); - if (dataUri != null) { - mContext.getContentResolver().update(dataUri, values, null, null); - } - } - } catch (ActivityNotFoundException e) { Toast.makeText(mContext, R.string.quickcontact_missing_app, Toast.LENGTH_SHORT) .show(); } + + // Hide the resolution list, if present + setResolveVisible(false, actionView); + this.dismiss(); + + if (mMakePrimary) { + ContentValues values = new ContentValues(1); + values.put(Data.IS_SUPER_PRIMARY, 1); + final Uri dataUri = action.getDataUri(); + if (dataUri != null) { + mContext.getContentResolver().update(dataUri, values, null, null); + } + } } else if (tag instanceof ActionList) { // Incoming tag is a MIME-type, so show resolution list final ActionList children = (ActionList)tag; -- 2.11.0