0

点击我的时钟小部件时,我正在使用此代码块启动默认闹钟。

public Intent getAlarmPackage(Context context)
{
    PackageManager packageManager = context.getPackageManager();
    Intent AlarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);

    String clockImpls[][] = {
            { "Standard Alarm", "com.android.alarmclock",
                    "com.android.alarmclock.AlarmClock" },
            { "HTC Alarm ClockDT", "com.htc.android.worldclock",
                    "com.htc.android.worldclock.WorldClockTabControl" },
            { "Standard Alarm ClockDT", "com.android.deskclock",
                    "com.android.deskclock.AlarmClock" },
            { "Froyo Nexus Alarm ClockDT",
                    "com.google.android.deskclock",
                    "com.android.deskclock.DeskClock" },
            { "Moto Blur Alarm ClockDT",
                    "com.motorola.blur.alarmclock",
                    "com.motorola.blur.alarmclock.AlarmClock" },
            { "Samsung Galaxy S", "com.sec.android.app.clockpackage",
                    "com.sec.android.app.clockpackage.ClockPackage" } };

但这不适用于Sony Xperia Z。有什么建议么?

4

2 回答 2

2

经过一番搜索,我设法找到了相应的活动:

{ "Sony Ericsson Xperia Z", "com.sonyericsson.organizer", "com.sonyericsson.organizer.Organizer_WorldClock" }   

作为替代 com.sonyericsson.organizer 还包含 - com.sonyericsson.alarm.SetAlarm

于 2013-11-23T20:34:54.123 回答
0

Organizer_WorldClock 打开一个世界时钟。要打开警报列表,最好只使用 Organizer

{ "Sony Ericsson Xperia Z", "com.sonyericsson.organizer", "com.sonyericsson.organizer.Organizer" }
于 2014-12-28T17:09:10.220 回答