package net.ichigotake.common.view.inputmethod;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public final class SoftInput {

    public static void hide(View targetView) {
        Context context = targetView.getContext();
        if (context == null) {
            return ;
        }

        InputMethodManager inputMethodManager = (InputMethodManager)context.getSystemService(
                Context.INPUT_METHOD_SERVICE
        );

        if (inputMethodManager == null) {
            return ;
        }

        inputMethodManager.hideSoftInputFromWindow(
                targetView.getWindowToken(),
                InputMethodManager.HIDE_NOT_ALWAYS
        );
    }
}

@@ -74,16 +74,41 @@
 ontext;%0A
+import android.util.Log;%0A
 import a
@@ -219,21 +219,22 @@
    p
-ublic
+rivate
  static 
 void
@@ -233,115 +233,152 @@
 tic 
-void hide(View targetView) %7B%0A        Context context = targetView.getContext();%0A        if (context == null
+final String LOG_TAG = SoftInput.class.getSimpleName();%0A%0A    @SuppressWarnings(%22ConstantConditions%22)%0A    public static void hide(View targetView
 ) %7B%0A
@@ -389,32 +389,18 @@
     
-  
-  return ;%0A        %7D%0A%0A
+try %7B%0A    
     
@@ -467,15 +467,52 @@
 ger)
-c
+%0A                    targetView.getC
 ontext
+()
 .get
@@ -525,33 +525,16 @@
 Service(
-%0A                
 Context.
@@ -557,95 +557,15 @@
 VICE
-%0A        
 );%0A
-%0A
     
-    if (inputMethodManager == null) %7B%0A            return ;%0A        %7D%0A%0A
     
@@ -620,32 +620,36 @@
                 
+    
 targetView.getWi
@@ -661,16 +661,20 @@
 oken(),%0A
+    
         
@@ -724,18 +724,111 @@
         
-);
+    );%0A        %7D catch (NullPointerException e) %7B%0A            Log.e(LOG_TAG, %22%22, e);%0A        %7D%0A
 %0A    %7D%0A%7D

fix can't hide soft input