public void notification_status(Activity activity, String title, String details)
{
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) activity.getSystemService(ns);
int icon = R.drawable.bulogo;
CharSequence tickerText = "My App";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
Context context = activity.getApplicationContext();
CharSequence contentTitle = title;
CharSequence contentText = details;
-----> Intent notificationIntent = new Intent(activity, ???????);
PendingIntent contentIntent = PendingIntent.getActivity(activity, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notification.sound = Uri.parse("android.resource://com.champloo.mugen/" + R.raw.beep);
mNotificationManager.notify(1, notification);
}
大家好,我做了这个方法,以便我在我的应用程序中的任何位置调用它以在状态栏上发布通知,如果用户暂时关闭程序,我不确定如何告诉程序返回到其最后一个活动......并且按下状态栏下的通知。
请帮忙!