0

So I am trying to implement using NotificationHelper to inform users on the progress of the download.

public class MapDownload extends AsyncTask<String, Integer, String>{
    public MapDownload(ArrayList<PlaceDetails> placeList, int travelogueID, Context mContext, String travelogueName){ 
        this.places = placeList;
        this.zoom = 12;
        this.tID = travelogueID;
        mNotificationHelper = new NotificationHelper(mContext, travelogueName);
    }

    @Override
    protected void onPreExecute(){
        //Create the notification in the statusbar
        mNotificationHelper.createNotification();
    }
}

However, I was wondering if it's possible to implement it such that if I launch another MapDownload class to download stuff, how can I do it such that both will be running concurrently? It seems that upon launching of the 2nd MapDownload, the 1st one disappears, and the previous notification will be replaced by the 2nd one.

Is this a problem of a wrong AsyncTask implementation, or wrong way of using NotificationHelper?

1 Answer 1

0

I don't know what NotificationHelper is, is it from a third party library?

However, when creating a notification you have to provide an ID. If the same ID is reused later, the previous notification get replaced. See NotificationManger documentation.

Maybe that what is happening.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.