2011-07-11 3 views
12

Je suis en train de développer une application pour Android 3.1. Existe-t-il un moyen d'afficher (ou de forcer) le clavier Android en mode plein écran?Clavier virtuel Android 3.1 en mode plein écran

+0

Juste une petite précision: Solutions mentionnées dans http://stackoverflow.com/questions/1109022/how-to-close-hide- le clavier-android-soft-ne fonctionne pas dans 3.1? – bschandramohan

+0

im pense que cette aide maybr vous http://stackoverflow.com/questions/4336762/disabling-the-fullscreen-editing-view-for-soft-keyboard-input-in-landscape http: //stackoverflow.com/questions/5171236/force-dialog-input-to-require-fullscreen-ime-soft-keyboard-in-landscape – test1

+0

J'ai le même problème dans ma vue de surface :(http://stackoverflow.com/questions/36914290/android-soft-clavier-dans-un-plein-écran-surface-view – railwanderer

Répondre

1

Essayez:

activity.getWindow().setSoftInputMode(
         WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 

Pour masquer ou:

activity.getWindow().setSoftInputMode(
         WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); 

ou:

activity.getWindow().setSoftInputMode(
         WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); 

L'un d'eux devrait vous aider :)

+1

une raison quelconque pour une réponse négative pour une réponse de 2 ans? – Codeman

-1

vient ici deux util fonctions, espérons que cela aide

public static void showSoftKeyboard (Context context, View view) { 
     try { 
      ((InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE)) 
      .showSoftInput(view, InputMethodManager.SHOW_FORCED); 
     } 
     catch (Exception ex) { 
      Log.w(TAG, "showSoftKeyboard->"+ex.toString()); 
     } 
    } 
    public static void hideSoftKeyboard (Context context, View view) { 
     try { 
      InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); 
      imm.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0); 
     } 
     catch (Exception ex) { 
      Log.w(TAG, "hideSoftKeyboard->"+ex.toString()); 
     } 
    } 


...
codage social @AspiroTV

Questions connexes