常规通知不会在Android中显示X关闭按钮

use*_*206 7 notifications android default button

我使用android.support.v4.app.NotificationCompat.Builder创建了一个通知.通知区域中的通知显示正常.但它没有显示android 4.2上的默认关闭按钮.

http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setOngoing(boolean)

根据docuentation,它是一种常规通知,应显示X关闭按钮但不显示.使用以下代码:

            mBuilder = new NotificationCompat.Builder(context);
            mBuilder.setSmallIcon(iconId);
            mBuilder.setContentTitle(titleText);
            mBuilder.setContentText(moreinfoText);
            mBuilder.setOngoing(false); //to make it regular
            PendingIntent pintent = 
                       PendingIntent.getActivity(context,noteId,resultIntent,PendingIntent.FLAG_UPDATE_CURRENT);
            mBuilder.setContentIntent(pintent);

            NotificationManager mNotificationManager =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
            mNotificationManager.notify(noteId, mBuilder.build());
Run Code Online (Sandbox Code Playgroud)

在Google上搜索但找不到类似的内容.请建议.

谢谢你的时间!