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,27 +1328,27 @@
final CheckableImageView actionView = isActionView ? (CheckableImageView)view : null;
final Object tag = view.getTag();
if (tag instanceof Action) {
+ // Incoming tag is concrete intent, so try launching
+ final Action action = (Action)tag;
+
+ try {
+ mContext.startActivity(action.getIntent());
+ } 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();
- 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);
- }
+ 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();
}
} else if (tag instanceof ActionList) {
// Incoming tag is a MIME-type, so show resolution list