【发布时间】:2014-01-31 17:32:31
【问题描述】:
我使用此代码发送通知。
public static void sendNotificationPhoto(Context context, Class<?> activityTarget)
{
Log.i( TAG , "Send Photo Notification");
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notifyDetails = new Notification(R.drawable.ic_plusone_standard_off_client, "New Alert!", System.currentTimeMillis());
Intent intent = new Intent(context, activityTarget);
int id = NOTIFICATION_ID_PHOTO;
String contentText = "Slave Picture Is Now Available!";
PendingIntent contentIntent = PendingIntent.getActivity(context.getApplicationContext(), id, intent, PendingIntent.FLAG_ONE_SHOT);
notifyDetails.setLatestEventInfo(context.getApplicationContext(), context.getString(R.string.app_name), contentText, contentIntent);
mNotificationManager.notify(id, notifyDetails);
}
但现在我不需要打开另一个活动,而是打开特定画廊的文件夹。可以通知吗?
【问题讨论】:
标签: android android-intent android-notifications android-gallery