I want to implement the back button functionality in my application. In application whenever I\'m clicking on back button in middle my control is going to login page direct
Depends on whether or not you want to support pre-Android 2.0 phones. The onBackPressed() method was added to Android 2.0 (API 5).
onBackPressed()
You may want to read this post on the Android Developer blog for details:
http://android-developers.blogspot.com/2009/12/back-and-other-hard-keys-three-stories.html