バージョン 2.3.X の一部の Android デバイスについて、バグ レポートがあります。
android.app.RemoteServiceException: startForeground の不正な通知: java.lang.IllegalArgumentException
これが私の方法です...
final static int myID = 6785674;
public void putServiceToForeground() {
if (notif == null) {
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(MyApp.getAppContext())
.setContentTitle("");
notif = mBuilder.build();
notif.icon = R.drawable.pixel;
}
startForeground(myID, notif);
}