mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
fix NPE
When nothing has focus can't close keyboard. (Likely it's not up in that case anyway.)
This commit is contained in:
parent
1c9b94efbc
commit
ad8451d5c9
1 changed files with 6 additions and 4 deletions
|
@ -824,10 +824,12 @@ public class DictBrowseDelegate extends DelegateBase
|
||||||
|
|
||||||
private void hideSoftKeyboard()
|
private void hideSoftKeyboard()
|
||||||
{
|
{
|
||||||
|
View hasFocus = m_activity.getCurrentFocus();
|
||||||
|
if ( null != hasFocus ) {
|
||||||
InputMethodManager imm = (InputMethodManager)
|
InputMethodManager imm = (InputMethodManager)
|
||||||
m_activity.getSystemService( Activity.INPUT_METHOD_SERVICE );
|
m_activity.getSystemService( Activity.INPUT_METHOD_SERVICE );
|
||||||
imm.hideSoftInputFromWindow( m_activity.getCurrentFocus()
|
imm.hideSoftInputFromWindow( hasFocus.getWindowToken(), 0 );
|
||||||
.getWindowToken(), 0);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void launch( Delegator delegator, Bundle bundle )
|
private static void launch( Delegator delegator, Bundle bundle )
|
||||||
|
|
Loading…
Add table
Reference in a new issue