Android: positioning of a toast

Hi.
My code for a toast is:

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

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

Kf

2 Likes