# バックボタンでアプリ内メッセージを閉じることはできますか？

{% hint style="warning" %}
**ここでは Android 固有の事象について取り扱っております**
{% endhint %}

SDKではAndroid端末のバックボタンの操作に関して関与することはありません。\
そのためバックボタンの操作をトリガーにアプリ内メッセージを閉じたい場合は、独自に実装を行う必要があります。

**実装サンプル**

{% code overflow="wrap" %}

```java
@Override
public void onBackPressed() {
  if (InAppMessaging.isPresenting) {
    InAppMessaging.dismiss();
  } else {
    super.onBackPressed();
  }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://app.developers.karte.io/app-faq/app-faq-back-button-support-for-iam.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
