BackButton pressed Issue
===

I am facing a problem of back button. In my application I want to implement a functionality that when the user clicks on the back button it should move on to the Home screen. For doing this I have written a code.

    @Override
    	public boolean onKeyDown(int keyCode, KeyEvent event) {
    	    if (keyCode == KeyEvent.KEYCODE_BACK) {
    	    
    	    	if(backCount==0){
    	    		backCount++;
    	    	Intent restartResearchActivity = new Intent(ResearchListNew.this,ResearchListNew.class);
    	    	startActivity(restartResearchActivity);
    	    	
    	    	}
    	    	
    	    	else{
    	    		
    
    	    		
    	    	}
    	    }
    
    	    return super.onKeyDown(keyCode, event);
    	}


I have used a static varialble int backCount=0 so that when the user is on the Home screen itself and wants to come out of the APP , then he should move to the else part of the above loop and should not again be prompted to the Home screen,

But suppose first time I used back button it worked correctly and backcount will be = 1 now then , after that If user clicks on the back button it will not move to the home screen as now backcount is greater than 0.

So kindly help me in this scenario.

Thanks