# Android: positioning of a toast

**URL:** <https://discourse.processing.org/t/android-positioning-of-a-toast/867>\
**Category:** Processing for Android\
**Created:** [June 11, 2018, 12:41pm UTC](https://discourse.processing.org/t/android-positioning-of-a-toast/867 "2018-06-11T12:41:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [June 11, 2018, 12:41pm UTC](https://discourse.processing.org/t/android-positioning-of-a-toast/867/1 "2018-06-11T12:41:02Z")

</div>

Hi.  
My code for a toast is:

```auto
void showToast(final String message) { 
  act.runOnUiThread(new Runnable() { 
    public void run() { 
      android.widget.Toast.makeText(act.getApplicationContext(), message, android.widget.Toast.LENGTH_SHORT).show();
    }
  }
  );
}

```

But how can I have another position other than the default on the bottem.  
Thanks

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [June 12, 2018, 1:35am UTC](https://discourse.processing.org/t/android-positioning-of-a-toast/867/2 "2018-06-12T01:35:09Z")

</div>

Use `setGravity()`: [https://stackoverflow.com/questions/2506876/how-to-change-position-of-toast-in-android?utm\_medium=organic&utm\_source=google\_rich\_qa&utm\_campaign=google\_rich\_qa](https://stackoverflow.com/questions/2506876/how-to-change-position-of-toast-in-android?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa)

Kf
