NotificationCompat.Builder mBuilder;
NotificationManager mNm;
void showNoti(String filename) {
if (mBuilder == null) {
mBuilder = new NotificationCompat.Builder(this);
mBuilder.setContentTitle(filename)
.setContentText(getString(R.string.file_sending))
.setSmallIcon(R.drawable.ic_launcher);
mNm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
mNm.notify(997, mBuilder.build());
}
执行以上代码,在手机状态栏上未有显示,请问
getSystemService(Context.NOTIFICATION_SERVICE); Context.NOTIFICATION_SERVICE内容应是什么?
------解决思路----------------------
public static final String NOTIFICATION_SERVICE = "notification";
这个就是个字符串而已。
------解决思路----------------------
这个要仔细查查源码.