mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-02 20:46:15 +01:00
fix crash posing Toast from non-looper Activities
This commit is contained in:
parent
f5947d25d9
commit
7e714ae547
1 changed files with 6 additions and 1 deletions
|
@ -136,7 +136,12 @@ public class Utils {
|
||||||
|
|
||||||
public static void showToast( Context context, String msg )
|
public static void showToast( Context context, String msg )
|
||||||
{
|
{
|
||||||
|
// Make this safe to call from non-looper threads
|
||||||
|
try {
|
||||||
Toast.makeText( context, msg, Toast.LENGTH_SHORT).show();
|
Toast.makeText( context, msg, Toast.LENGTH_SHORT).show();
|
||||||
|
} catch ( java.lang.RuntimeException re ) {
|
||||||
|
DbgUtils.loge( re );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showToast( Context context, int id )
|
public static void showToast( Context context, int id )
|
||||||
|
|
Loading…
Add table
Reference in a new issue