Android Fragments back key press cannot be caught
===

I am using fragments i android 4.0. I have loaded an class extending Activity and inside that I loaded a class extending Fragment. Now I want to catch the back button pressed event. I used the method onBackPressed(). but its is not working. In some cases I am using classes that are extending Activity inside frament. in such cases it is working. Can anybody tell be the reason and a solution.