-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ProcessPidCallback to cancel a specific download #171
Conversation
…by using killPorcess.
The idea looks good. But in my opinion, letting the library itself manage the process(es) and call |
Does it work on this method!
|
Instead of exposing the pid directly to the outside caller, my solution is that the caller manually specifies an |
Your solution may be better. |
if (matcher.find()) { | ||
String pidInfo[] = matcher.group().split(",\\s+"); | ||
String pidPair[] = pidInfo[0].split("="); | ||
pidCallback.onProcessRun(pidPair[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to check pidCallback for nullity. Otherwise java will throw NullPointerException when pidCallback is not specified.
Please check this #173 |
Thanks all reviews and suggestions! |
I'm using this lib in our project and I need to find a way to cancel a specific download progress,
this is how I achieve this purpose.
https://play.google.com/store/apps/details?id=cc.ytmp3.gp