From e2bf873e9f5d1011cbcd240242507b5862d79558 Mon Sep 17 00:00:00 2001 From: lado Date: Wed, 25 Jan 2012 00:27:00 +0100 Subject: position toast on center --- vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vdrmanager') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java index c88ba8c..39f03b3 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java @@ -4,6 +4,7 @@ import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; +import android.view.Gravity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; @@ -193,11 +194,13 @@ public abstract class BaseActivity extends ICSBaseAc // } protected void say(int res) { - Toast.makeText(this, res, Toast.LENGTH_SHORT).show(); + say(this.getString(res)); } protected void say(String msg) { - Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); + Toast t = Toast.makeText(this, msg, Toast.LENGTH_SHORT); + t.setGravity(Gravity.CENTER, 0, 0); + t.show(); } protected boolean noConnection(SvdrpEvent event) { -- cgit v1.2.3