From: Jeff Sharkey Date: Fri, 2 Oct 2009 02:51:14 +0000 (-0700) Subject: Dismiss FastTrack only after calling startActivity(). X-Git-Tag: android-x86-2.2~159^2~7^2~69 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e1032fa194fbb9117b511e17f9cac60d61fd11f1;p=android-x86%2Fpackages-apps-Contacts.git 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 --- 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;