mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +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 )
|
||||
{
|
||||
Toast.makeText( context, msg, Toast.LENGTH_SHORT).show();
|
||||
// Make this safe to call from non-looper threads
|
||||
try {
|
||||
Toast.makeText( context, msg, Toast.LENGTH_SHORT).show();
|
||||
} catch ( java.lang.RuntimeException re ) {
|
||||
DbgUtils.loge( re );
|
||||
}
|
||||
}
|
||||
|
||||
public static void showToast( Context context, int id )
|
||||
|
|
Loading…
Add table
Reference in a new issue