forked from extern/Unexpected-Keyboard
Fix crash when switching app
This commit is contained in:
parent
38adf7d7b9
commit
100e0b270d
@ -20,6 +20,7 @@ import android.view.ContextThemeWrapper;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.util.Log;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -188,6 +189,15 @@ public class Keyboard2 extends InputMethodService
|
||||
setInputView(_keyboardView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputView(View v)
|
||||
{
|
||||
ViewParent parent = v.getParent();
|
||||
if (parent != null && parent instanceof ViewGroup)
|
||||
((ViewGroup)parent).removeView(v);
|
||||
super.setInputView(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user