Vote count:
0
In my android application I am using a thread to download some data.
Here is a prototype of currently working code:
void startThread()
{
thread = new Thread(this);
thread.setPriority(Process.THREAD_PRIORITY_BACKGROUND);
thread.start();
}
@Override
public void run()
{
while(application_running)
{
//download my data...
}
}
Problem occurs when downloading data form the server is very slow. Although i close the application: data download thread remains alive. But i need this thread to close immediately after application close.
Is there any way to force close it? Or any other standard way to download data?
asked 30 secs ago
Force Closing Thread in Android
Aucun commentaire:
Enregistrer un commentaire