1 package org.openintents.filemanager.compatibility;
\r
3 import android.content.Context;
\r
4 import android.os.IBinder;
\r
5 import android.view.inputmethod.InputMethodManager;
\r
8 * Wraper class for closing the software keyboard, which appeared in API 3.
\r
11 public class SoftKeyboard {
\r
12 /* class initialization fails when this throws an exception */
\r
15 Class.forName("android.view.inputmethod.InputMethodManager");
\r
16 } catch (Exception ex) {
\r
17 throw new RuntimeException(ex);
\r
21 /* calling here forces class initialization */
\r
22 public static void checkAvailable() {}
\r
24 private InputMethodManager inputMethodManager;
\r
26 public SoftKeyboard(Context ctx){
\r
27 inputMethodManager = (InputMethodManager) ctx.getSystemService(
\r
28 Context.INPUT_METHOD_SERVICE);
\r
31 public boolean hideSoftInputFromWindow(IBinder windowToken, int flags){
\r
32 return inputMethodManager.hideSoftInputFromWindow(windowToken, flags);
\r