Fix ghost keyboard issue with multiple uploads

This commit is contained in:
YuviPanda 2013-04-03 00:11:02 +05:30
parent f7ec318179
commit 53ffac92b2

View file

@ -10,6 +10,7 @@ import android.os.*;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.text.*; import android.text.*;
import android.view.*; import android.view.*;
import android.view.inputmethod.InputMethodManager;
import android.widget.*; import android.widget.*;
import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.MenuItem;
@ -72,6 +73,12 @@ public class MultipleShareActivity
if(categorizationFragment == null) { if(categorizationFragment == null) {
categorizationFragment = new CategorizationFragment(); categorizationFragment = new CategorizationFragment();
} }
// FIXME: Stops the keyboard from being shown 'stale' while moving out of this fragment into the next
View target = this.getCurrentFocus();
if (target != null) {
InputMethodManager imm = (InputMethodManager) target.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(target.getWindowToken(), 0);
}
getSupportFragmentManager().beginTransaction() getSupportFragmentManager().beginTransaction()
.add(R.id.uploadsFragmentContainer, categorizationFragment, "categorization") .add(R.id.uploadsFragmentContainer, categorizationFragment, "categorization")
.commit(); .commit();