mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
add assertOnUIThread()
This commit is contained in:
parent
15cbad340a
commit
29a4634a40
1 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,7 @@ import android.content.SharedPreferences;
|
|||
import android.database.Cursor;
|
||||
import android.database.DatabaseUtils;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.Time;
|
||||
|
@ -37,6 +38,7 @@ import java.util.ArrayList;
|
|||
import java.util.Formatter;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import junit.framework.Assert;
|
||||
|
||||
public class DbgUtils {
|
||||
private static final String TAG = "XW4";
|
||||
|
@ -92,6 +94,11 @@ public class DbgUtils {
|
|||
printStack( exception.getStackTrace() );
|
||||
}
|
||||
|
||||
public static void assertOnUIThread()
|
||||
{
|
||||
Assert.assertTrue( Looper.getMainLooper().equals(Looper.myLooper()) );
|
||||
}
|
||||
|
||||
public static void printStack( StackTraceElement[] trace )
|
||||
{
|
||||
if ( s_doLog ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue