1. The constructor was deprecated in api level 11. so you should use Notification.Builder
.
for e.g.
Notification notification = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.build();
2. in your code you are passing the intent instead of pending in setLatestEventInfo
....
Intent intent = new Intent(context,MainActivity.class);
PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);
notify.setLatestEventInfo(context, title, details, pending);
ns.notify(0,notify);
....