mirror of https://github.com/axmolengine/axmol.git
UI thread check.
This commit is contained in:
parent
a472ab2931
commit
cf883b5c0f
|
@ -28,6 +28,7 @@ import android.content.Context;
|
|||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -394,6 +395,11 @@ public class Cocos2dxEditBoxHelper {
|
|||
}
|
||||
|
||||
private static void closeKeyboardOnUiThread(int index) {
|
||||
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
Log.e(TAG, "closeKeyboardOnUiThread doesn't run on UI thread!");
|
||||
return;
|
||||
}
|
||||
|
||||
final InputMethodManager imm = (InputMethodManager) mCocos2dxActivity.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
Cocos2dxEditBox editBox = mEditBoxArray.get(index);
|
||||
if (null != editBox) {
|
||||
|
|
Loading…
Reference in New Issue