use of android.app.Notification in project making-apps-beautiful by ankurkotwal.
the class ArticleListFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.refresh) {
DummyContent.DummyItem dummy = DummyContent.ITEMS.get(0);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 16;
Bitmap photo = BitmapFactory.decodeResource(getResources(), dummy.photoResId);
Notification n = new NotificationCompat.Builder(getActivity()).setContentTitle("Article published").setSmallIcon(R.drawable.stat_icon).setDefaults(Notification.DEFAULT_SOUND).setLargeIcon(photo).setStyle(new NotificationCompat.BigPictureStyle().bigPicture(photo).setSummaryText(dummy.title)).setContentText(dummy.title).setContentIntent(PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).setAutoCancel(true).addAction(R.drawable.ic_share, "Share", PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).build();
NotificationManager nm = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(1, n);
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.app.Notification in project making-apps-beautiful by ankurkotwal.
the class ArticleListFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.refresh) {
DummyContent.DummyItem dummy = DummyContent.ITEMS.get(0);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 16;
Bitmap photo = BitmapFactory.decodeResource(getResources(), dummy.photoResId);
Notification n = new NotificationCompat.Builder(getActivity()).setContentTitle("Article published").setSmallIcon(R.drawable.stat_icon).setDefaults(Notification.DEFAULT_SOUND).setLargeIcon(photo).setStyle(new NotificationCompat.BigPictureStyle().bigPicture(photo).setSummaryText(dummy.title)).setContentText(dummy.title).setContentIntent(PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).setAutoCancel(true).addAction(R.drawable.ic_share, "Share", PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).build();
NotificationManager nm = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(1, n);
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.app.Notification in project making-apps-beautiful by ankurkotwal.
the class ArticleListFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.refresh) {
DummyContent.DummyItem dummy = DummyContent.ITEMS.get(0);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 16;
Bitmap photo = BitmapFactory.decodeResource(getResources(), dummy.photoResId);
Notification n = new NotificationCompat.Builder(getActivity()).setContentTitle("Article published").setSmallIcon(R.drawable.stat_icon).setDefaults(Notification.DEFAULT_SOUND).setLargeIcon(photo).setStyle(new NotificationCompat.BigPictureStyle().bigPicture(photo).setSummaryText(dummy.title)).setContentText(dummy.title).setContentIntent(PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).setAutoCancel(true).addAction(R.drawable.ic_share, "Share", PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).build();
NotificationManager nm = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(1, n);
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.app.Notification in project making-apps-beautiful by ankurkotwal.
the class ArticleListFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.refresh) {
DummyContent.DummyItem dummy = DummyContent.ITEMS.get(0);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 16;
Bitmap photo = BitmapFactory.decodeResource(getResources(), dummy.photoResId);
Notification n = new NotificationCompat.Builder(getActivity()).setContentTitle("Article published").setSmallIcon(R.drawable.stat_icon).setDefaults(Notification.DEFAULT_SOUND).setLargeIcon(photo).setStyle(new NotificationCompat.BigPictureStyle().bigPicture(photo).setSummaryText(dummy.title)).setContentText(dummy.title).setContentIntent(PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).setAutoCancel(true).addAction(R.drawable.ic_share, "Share", PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).build();
NotificationManager nm = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(1, n);
return true;
}
return super.onOptionsItemSelected(item);
}
use of android.app.Notification in project making-apps-beautiful by ankurkotwal.
the class ArticleListFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.refresh) {
DummyContent.DummyItem dummy = DummyContent.ITEMS.get(0);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 16;
Bitmap photo = BitmapFactory.decodeResource(getResources(), dummy.photoResId);
Notification n = new NotificationCompat.Builder(getActivity()).setContentTitle("Article published").setSmallIcon(R.drawable.stat_icon).setDefaults(Notification.DEFAULT_SOUND).setLargeIcon(photo).setStyle(new NotificationCompat.BigPictureStyle().bigPicture(photo).setSummaryText(dummy.title)).setContentText(dummy.title).setContentIntent(PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).setAutoCancel(true).addAction(R.drawable.ic_share, "Share", PendingIntent.getActivity(getActivity(), 0, new Intent(getActivity(), getActivity().getClass()), PendingIntent.FLAG_UPDATE_CURRENT)).build();
NotificationManager nm = (NotificationManager) getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(1, n);
return true;
}
return super.onOptionsItemSelected(item);
}
Aggregations