OSDN Git Service

Dismiss FastTrack only after calling startActivity().
authorJeff Sharkey <jsharkey@android.com>
Fri, 2 Oct 2009 02:51:14 +0000 (19:51 -0700)
committerJeff Sharkey <jsharkey@android.com>
Fri, 2 Oct 2009 19:10:01 +0000 (12:10 -0700)
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

src/com/android/contacts/ui/QuickContactWindow.java

index 756dd1e..747c204 100644 (file)
@@ -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;