Cocos2dxGLSurfaceView little modify.

This commit is contained in:
yangws 2011-04-26 16:40:49 +08:00
parent 9b08f4add6
commit a73ccaf0e3
2 changed files with 6 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.ViewGroup.LayoutParams;
import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.ExtractedText; import android.view.inputmethod.ExtractedText;
@ -170,12 +171,12 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
if (imm == null) { if (imm == null) {
return; return;
} }
imm.showSoftInput(mainView, InputMethodManager.SHOW_IMPLICIT); imm.showSoftInput(mainView, 0);
} }
public static void closeIMEKeyboard() { public static void closeIMEKeyboard() {
if (null != mainView) { if (null == mainView) {
Log.d("Cocos2dxGLSurfaceView", "closeIMEKeyboard"); return;
} }
InputMethodManager imm = (InputMethodManager)mainView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager)mainView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm == null) { if (imm == null) {

View File

@ -174,8 +174,8 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
} }
public static void closeIMEKeyboard() { public static void closeIMEKeyboard() {
if (null != mainView) { if (null == mainView) {
Log.d("Cocos2dxGLSurfaceView", "closeIMEKeyboard"); return;
} }
InputMethodManager imm = (InputMethodManager)mainView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager)mainView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm == null) { if (imm == null) {