# Onbackpress to go out of application

**URL:** <https://devforum.zoom.us/t/onbackpress-to-go-out-of-application/9297>\
**Category:** Android\
**Created:** [March 23, 2020, 1:23pm UTC](https://devforum.zoom.us/t/onbackpress-to-go-out-of-application/9297 "2020-03-23T13:23:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [March 25, 2020, 3:25am UTC](https://devforum.zoom.us/t/onbackpress-to-go-out-of-application/9297/4 "2020-03-25T03:25:51Z")

</div>

Hi [aadil9265711](https://devforum.zoom.us/u/aadil9265711),

Thanks for the reply. I understand your request and the link includes the discussion of how to do what you are mentioning. I have just tested with our demo app(sample), using default UI, and I am able to override the back button action. Here are the steps:

1. Create your own activity, for example, MyMeetingActivity
2. In `config.xml`, add the following:

```auto
<string name="zm_config_conf_activity">us.zoom.sdksample.MyMeetingActivity</string>

```

1. Declare the Activity in your AndroidManifest.xml
2. In your `MyMeetingActivity` class, `extends MeetingActivity`

```auto
public class MyMeetingActivity extends MeetingActivity {
...
}

```

1. Override the onBackPressed method:

```auto
@Override
    public void onBackPressed() {
 onClickLeave();
...
}

```

1. If you would like define other actions other than calling the leave meeting dialog, you can do whatever you prefer in this callback.

Hope this helps. Thanks!

---

_[View the full topic](https://devforum.zoom.us/t/onbackpress-to-go-out-of-application/9297)._
