2

I am having error that whenever I update the notification it puts my notification on Top and then notification from other app comes first and and when my notification is updated again(every 1 sec) my notification comes on top again and this goes on. I want to update my notification without putting to the top all the time.

    @Override
    public void onDownloadProgress(String taskId, final int size,String progress_String,int status,String filename,int type)
       {
             if(mBuilder == null || mNotifyManager == null){
                 mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
                mBuilder = new NotificationCompat.Builder(context);
                mBuilder.setContentTitle(""+filename);
                 if(type == TYPE_AUDIO){
                    mBuilder.setSmallIcon(R.drawable.audio_icon);
                }else{
                    mBuilder.setSmallIcon(R.drawable.vide_icon);
                 }
                mBuilder.setSound(null)
               .setVibrate(new long[0]);

             }


                i.putExtra(CODE_PROGRESS, "-> "+size+"%"+progress_String);
                  Preference_Manager.set_To_String_List_To_Shared_Preferences(context, ids.indexOf(taskId), "-> "+size+"%"+progress_String, DOWNLOAD_LIST_PROGRESS);
                mBuilder.setProgress(100, size, false);
            mBuilder.setContentText("-> "+size+" %"+progress_String);
                mNotifyManager.notify(taskId.hashCode(), mBuilder.build());

        }

0 Answers0