How to quit an application programmatically through button click
<p>I want to quit application through button click.</p>

<p>the code for button click is</p>

<pre><code>quitBtn.setOnClickListener(new View.OnClickListener() {         
    @Override
    public void onClick(View paramView) {
        // TODO Auto-generated method stub              
        MainActivity.this.finish();
    }
});
</code></pre>

<p>But it require two clicks to exit from the app.</p>
