代码如下,它有什么问题吗?
XSSFWorkbook
我正在使用Mac Numbers测试生成的excel文件。
注意:将HSSFWorkbook
切换为protected NotificationCompat.Builder initBaseNotificationBuilder() {
NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(mContext);
notifBuilder.setDefaults(Notification.DEFAULT_ALL);
notifBuilder.setWhen(System.currentTimeMillis());
notifBuilder.setOnlyAlertOnce(false);
notifBuilder.setAutoCancel(true);
notifBuilder.setLargeIcon(BitmapFactory.decodeResource(mContext.getResources(), R.drawable.ic_launcher));
Intent intent = new Intent(mContext, HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
ActivityManager activityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> services = activityManager
.getRunningTasks(Integer.MAX_VALUE);
boolean isActivityFound = false;
if (services.get(0).topActivity.getPackageName()
.equalsIgnoreCase(mContext.getPackageName())) {
isActivityFound = true;
}
PendingIntent notifyPIntent;
if (isActivityFound) {
notifyPIntent = PendingIntent.getActivity(mContext.getApplicationContext(), 0,
intent, 0);
} else {
notifyPIntent = PendingIntent.getActivity(mContext.getApplicationContext(), 0,
new Intent(), 0);
}
notifBuilder.setContentIntent(notifyPIntent);
return notifBuilder;
}
时,代码仍可正常工作。