How to Pause downloadmanager in android -


i want allow user pause download's button click or click on notification of downloads , code

downloadbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) {     if(allow.equals(true)){          uri downloaduri = uri.parse(download_file);         downloadmanager.request request = new downloadmanager.request(downloaduri);           request.setallowednetworktypes(downloadmanager.request.network_wifi);         request.setallowedoverroaming(false);          //request.setnotificationvisibility(request.visibility_visible_notify_completed);          id =  downloadmanager.enqueue(request);          //save request id         sharedpreferences.editor prefedit = preferencemanager.edit();         prefedit.putlong(strpref_download_id, id);         prefedit.commit();     } 

});


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -