دوستان کد اولی که گذاشتم درست بود
میتونید برای کلاس هاتون از این کد استفاده کنید
میتونید برای کلاس هاتون از این کد استفاده کنید
کد پیاچپی:
public static void Notificationm(Context context,String Title,String Detils,String packge){
NotificationManager nm=(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notify=new Notification(R.drawable.ic_launcher,"شما یک پیام دارید",System.currentTimeMillis());
notify.flags |= Notification.FLAG_AUTO_CANCEL; //Do not clear the notification
notify.flags |= Notification.FLAG_NO_CLEAR; //Do not clear the notification
notify.flags |= Notification.FLAG_SHOW_LIGHTS; //Do not clear the notification
notify.defaults |= Notification.DEFAULT_LIGHTS; // LED
notify.defaults |= Notification.DEFAULT_SOUND; // Sound
CharSequence title=Title;
CharSequence detils=Detils;
Intent nazar = new Intent(
Intent.ACTION_VIEW,
Uri.parse("http://cafebazaar.ir/app/"+packge+"/?l=fa"));
//Intent intent=new Intent(context,send.class );
PendingIntent pend=PendingIntent.getActivity(context, 0, nazar, 0);
notify.setLatestEventInfo(context, title, detils, pend);
nm.notify(0,notify);
}