无法解析setLatestEventInfo(Notfication)

时间:2015-10-29 09:43:23

标签: android

我意识到之前已经问过这个问题,但我似乎无法将一个可行的解决方案集成到我自己的代码中,因为我对Android开发的这一方面还很陌生。

我使用此example作为参考,但我无法理解如何改变它。

以下是我想要更改的代码段:

private void handleCommand(Intent intent) {
        CharSequence text = getText(R.string.service_running);

        // Set the icon, scrolling text and timestamp
        Notification notification = new Notification(R.drawable.ic_launcher,
                text, System.currentTimeMillis());

        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
                new Intent(this, Launcher.class), 0);

        // Set the info for the views that show in the notification panel.
        notification.setLatestEventInfo(this, text, text, contentIntent);

        startForegroundCompat(R.string.service_running, notification);

        startMonitorThread((ActivityManager) this
                .getSystemService(Context.ACTIVITY_SERVICE));
    }

非常感谢任何帮助 提前谢谢!!!

1 个答案:

答案 0 :(得分:0)

相关问题