OSDN Git Service

Launch the Genie widget when the weather is tapped.
authorDaniel Sandler <dsandler@google.com>
Thu, 5 Nov 2009 21:19:26 +0000 (16:19 -0500)
committerDaniel Sandler <dsandler@google.com>
Thu, 5 Nov 2009 21:36:09 +0000 (16:36 -0500)
Fixes: http://b/2240161

src/com/android/deskclock/DeskClock.java

index 7c0e63e..51ebbdb 100644 (file)
@@ -622,6 +622,18 @@ public class DeskClock extends Activity {
                 return true;
             }
         });
+
+        final View weatherView = findViewById(R.id.weather);
+        weatherView.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                if (!supportsWeather()) return;
+
+                Intent genieAppQuery = getPackageManager().getLaunchIntentForPackage(GENIE_PACKAGE_ID);
+                if (genieAppQuery != null) {
+                    startActivity(genieAppQuery);
+                }
+            }
+        });
     }
 
     @Override