Search code examples
androidandroid-asynctasktelnet

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


Solution

  • Well you can try this:

    protected Void doInBackground() {
        Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
    /* do the work */
    }