Handling multiple AsyncTask launches
<p>I've  got <code>AsyncTask</code> in my <code>Activity</code>, when user clicks button, I start an <code>AsyncTask</code>:</p>

<pre><code>    @Override
    public void onClick(View view) {
        switch(view.getId()){
        case R.id.btnLogin:
            if(task==null){
                task=new LoginTask(this);
                task.execute();
            }
            break;

        }
    }
</code></pre>

<p>But if user clicks button <strong>after task is completed</strong>, <strong>I want it to be executed one more  time</strong>. What should I do accomplish this? Should I create new task every time user clicks button? Is it OK to create new instance if task is already running?
Also, <strong>task is static inner class</strong>, in order to handle screen rotation.</p>
