gilas1368
دوشنبه 07 اردیبهشت 1394, 12:22 عصر
سلام ب تمام اساتید محترم
راستش من با notification ب مشکل خوردم
من با کد زیر ی notif رو نمایش میدم:
private void sendNotification(int price) {
Uri path = Uri.parse("android.resource://MyPackegae/" + R.raw.tune_stats);
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE );
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("LAMS")
.setContentText("حساب شما به میزان " + price + " شارژ گردید.")
.setSound(path)
.setVibrate(new long[]{400, 400, 800, 1000});
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
اما ی مشکل دارم و اونم اینه ک زمانی ک نوتیف رو نمایش میده بلافاصله نوتیف پاک میشه حتی در بعضی از موارد هنوز ویبره نوتیف میاد نوتیفه حذف میشه و نمایش داده نمیشه
میخواستم ببینم علت این امر چیه؟:متفکر:
راستش من با notification ب مشکل خوردم
من با کد زیر ی notif رو نمایش میدم:
private void sendNotification(int price) {
Uri path = Uri.parse("android.resource://MyPackegae/" + R.raw.tune_stats);
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE );
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("LAMS")
.setContentText("حساب شما به میزان " + price + " شارژ گردید.")
.setSound(path)
.setVibrate(new long[]{400, 400, 800, 1000});
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
}
اما ی مشکل دارم و اونم اینه ک زمانی ک نوتیف رو نمایش میده بلافاصله نوتیف پاک میشه حتی در بعضی از موارد هنوز ویبره نوتیف میاد نوتیفه حذف میشه و نمایش داده نمیشه
میخواستم ببینم علت این امر چیه؟:متفکر: