我为我的 android 应用程序集成了推送通知,我想为任何 android 手机/标签打开/关闭推送通知,任何人都可以帮我...
protected void onPostExecute(BlogInfo result){
if(result.IsNew && result.Blog != null){
NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.logo, "THE BUTCHER BARKS", System.currentTimeMillis());
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.defaults |= Notification.DEFAULT_ALL;
Intent intent = new Intent(Service.this, Bark.class);
PendingIntent pendingIntent = PendingIntent.getActivity(GuruService.this, 0, intent, 0);
notification.setLatestEventInfo(getApplicationContext(), "BARKS", result.Blog.Title, pendingIntent);
manager.notify(1, notification);
}
}