I am developing an app in which `MainActivity` extends Fragment. Here is I need to call `onBackPressed` for some usage. How can I achieve this?

I used below code which does not worked

```
class MainActivity extends Freagment{
.
.
.
.

Override
public void onBackPressed() {
    super.onBackPressed();
}
}

```

The previous page is just like this

```
class LoadWebData extends Activity
{
.
.
.
}

```