diff options
author | nobunobuta <nobunobuta@nobunobuta.com> | 2010-01-28 21:21:23 +0900 |
---|---|---|
committer | nobunobuta <nobunobuta@nobunobuta.com> | 2010-01-28 21:21:23 +0900 |
commit | e77aa431d8f8871f447196c52ba13780e79102aa (patch) | |
tree | aae8dd6e840525cdca167c3aaff09451ccd5afe1 | |
parent | da2014c104c2056a61da7a2699bcfd44880b050d (diff) | |
download | android_packages_apps_DeskClock-e77aa431d8f8871f447196c52ba13780e79102aa.tar.gz android_packages_apps_DeskClock-e77aa431d8f8871f447196c52ba13780e79102aa.tar.bz2 android_packages_apps_DeskClock-e77aa431d8f8871f447196c52ba13780e79102aa.zip |
Enable Music Button
Signed-off-by: nobunobuta <nobunobuta@nobunobuta.com>
-rw-r--r-- | src/com/android/deskclock/DeskClock.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/deskclock/DeskClock.java b/src/com/android/deskclock/DeskClock.java index 29b19a4a7..c0af968bb 100644 --- a/src/com/android/deskclock/DeskClock.java +++ b/src/com/android/deskclock/DeskClock.java @@ -21,6 +21,7 @@ import android.app.AlarmManager; import android.app.AlertDialog; import android.app.PendingIntent; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -687,9 +688,13 @@ public class DeskClock extends Activity { musicButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { - Intent musicAppQuery = getPackageManager() - .getLaunchIntentForPackage(MUSIC_PACKAGE_ID) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP); +// Intent musicAppQuery = getPackageManager() +// .getLaunchIntentForPackage(MUSIC_PACKAGE_ID) +// .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP); + Intent musicAppQuery = new Intent(Intent.ACTION_MAIN); + musicAppQuery.setComponent(new ComponentName(MUSIC_PACKAGE_ID,"com.android.music.MusicBrowserActivity")); + musicAppQuery.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP); + if (musicAppQuery != null) { startActivity(musicAppQuery); } |