80,330
社区成员
发帖
与我相关
我的任务
分享
public static int ShowNotify(Context c,String title,String content,String tick,String url,int img)
{
if(img<1)
img=R.drawable.ic_launcher;
if(mPushManager==null)
{
mPushManager=(NotificationManager) c.getSystemService(NOTIFICATION_SERVICE);
}
Notification notificationNews = new Notification(img,title, System.currentTimeMillis());
// 定义下拉通知栏时要展现的内容信息
CharSequence contentTitleJob = title;
CharSequence contentTextJob = content;
Bundle jobBundle = new Bundle();
jobBundle.putString("url", url);
Intent i = new Intent(c,NotifyActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.putExtras(jobBundle);
i.putExtra("destory", true);
PendingIntent contentIntentJob = PendingIntent
.getActivity(c, 0,
i,
PendingIntent.FLAG_UPDATE_CURRENT);
notificationNews.setLatestEventInfo(c,
contentTitleJob, contentTextJob,
contentIntentJob);
notificationNews.flags |= Notification.FLAG_AUTO_CANCEL;
// voice();
mPushManager.notify(0, notificationNews);
// c.startForeground(0, notificationNews);
//mIntTest++;
//Notification.Builder
return 0;
}