Am creating an app in which background service decrypt downloaded file in the folder and will show file the file. Once user click on selected file it will start decrypting, if user click on that button decryption will stop and will start with new file. I tried using thread for to start and stop this task.
if (mUpdate!=null) {
mUpdate.interrupt();
}
mUpdate=new Thread() {
@Override
public void run() {
while (!interrupted()) {
// decryption of file and showing file to user
}
}
};
mUpdate.start();