Example usage for android.widget Toast getGravity

List of usage examples for android.widget Toast getGravity

Introduction

In this page you can find the example usage for android.widget Toast getGravity.

Prototype

public int getGravity() 

Source Link

Document

Get the location at which the notification should appear on the screen.

Usage

From source file:ca.mcgill.hs.serv.LogFileUploaderService.java

/**
 * Helper method for making toasts./*w  ww.j av a2  s .c o m*/
 * 
 * @param message
 *            The text to toast.
 * @param duration
 *            The duration of the toast.
 */
private void makeToast(final String message, final int duration) {
    final Toast slice = Toast.makeText(getBaseContext(),
            getResources().getString(R.string.uploader_appname_label) + message, duration);
    slice.setGravity(slice.getGravity(), slice.getXOffset(), slice.getYOffset() + 100);
    slice.show();
}