Handle back press in tabs with fragment
问题 I am using FragmentTabHost in my app. I have three tabs. Each tab shows a Fragment. addTab("Tab1", R.drawable.ic_launcher, Fragment1.class); addTab("Tab2", R.drawable.ic_launcher, Fragment2.class); addTab("Tab3", R.drawable.ic_launcher, Fragment3.class); addTab("Tab3", R.drawable.ic_launcher, Fragment4.class); When I press back from any of these tabs, the app is closed and home screen is shown. Now what I want is, when I press back from Tab1, the app should close. However, if I press back