src/core/android/SDL_android.cpp
changeset 6654 2ecfb25be1e2
parent 6653 b73f8ee5f033
child 6792 a15821a3471f
     1.1 --- a/src/core/android/SDL_android.cpp	Sun Nov 04 20:20:53 2012 -0800
     1.2 +++ b/src/core/android/SDL_android.cpp	Sun Nov 04 21:53:28 2012 -0800
     1.3 @@ -957,39 +957,30 @@
     1.4      return 0;
     1.5  }
     1.6  
     1.7 -extern "C" int Android_JNI_ShowTextInput(SDL_Rect *inputRect)
     1.8 +extern "C" void Android_JNI_ShowTextInput(SDL_Rect *inputRect)
     1.9  {
    1.10      JNIEnv *env = Android_JNI_GetEnv();
    1.11      if (!env) {
    1.12 -        return -1;
    1.13 +        return;
    1.14      }
    1.15  
    1.16      jmethodID mid = env->GetStaticMethodID(mActivityClass, "showTextInput", "(IIII)V");
    1.17      if (!mid) {
    1.18 -        return -1;
    1.19 +        return;
    1.20      }
    1.21      env->CallStaticVoidMethod( mActivityClass, mid,
    1.22                                 inputRect->x,
    1.23                                 inputRect->y,
    1.24                                 inputRect->w,
    1.25                                 inputRect->h );
    1.26 -    return 0;
    1.27  }
    1.28  
    1.29 -/*extern "C" int Android_JNI_HideTextInput()
    1.30 +extern "C" void Android_JNI_HideTextInput()
    1.31  {
    1.32 -    JNIEnv *env = Android_JNI_GetEnv();
    1.33 -    if (!env) {
    1.34 -        return -1;
    1.35 -    }
    1.36 -
    1.37 -    jmethodID mid = env->GetStaticMethodID(mActivityClass, "hideTextInput", "()V");
    1.38 -    if (!mid) {
    1.39 -        return -1;
    1.40 -    }
    1.41 -    env->CallStaticVoidMethod(mActivityClass, mid);
    1.42 -    return 0;
    1.43 -}*/
    1.44 +    // has to match Activity constant
    1.45 +    const int COMMAND_TEXTEDIT_HIDE = 3;
    1.46 +    Android_JNI_SendMessage(COMMAND_TEXTEDIT_HIDE, 0);
    1.47 +}
    1.48  
    1.49  //////////////////////////////////////////////////////////////////////////////
    1.50  //