Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

async task taking too long to do the job

I need to send a command from device and progressdialog should display progress until command is finished.For this purpose i use asynctask in my application. But it is taking much time to finish the command.

So, is there any way to set priority of asynctask to maximum?

Any suggestion will be appreciated. Thanks in advance

like image 457
krishna Avatar asked Nov 27 '22 17:11

krishna


1 Answers

Well you can try this:

protected Void doInBackground() {
    Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
/* do the work */
}
like image 154
Usama Sarwar Avatar answered Dec 15 '22 17:12

Usama Sarwar