0

当我添加 samsung multiwindow sdk 时,我意识到在运行 android 4.2 和 4.3 的 Galaxy 手机上显示软键盘有问题。如果我不使用三星多窗口 SDK,软键盘可以正常工作。我正在使用这个搜索栏库。也许它也与这个库有关。此外,我还尝试使用以下代码强制显示软键盘;但仍然看不到键盘。

InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,  InputMethodManager.HIDE_IMPLICIT_ONLY); 

清单文件(站点):

   <uses-library android:required="false" android:name="com.sec.android.app.multiwindow"> </uses-library>
   <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />

    <intent-filter>
      <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
    </intent-filter>
4

1 回答 1

0
<meta-data android:name="com.samsung.android.sdk.multiwindow.enable" android:value="true" />

我遇到的问题(软键盘未显示在 searcbar 的焦点上)是因为启用了多窗口元数据。所以我在 values-v18 和 values-v19 下定义了两个“bool.xml”,以禁用 Kitkat 下的三星多窗口库。

改成这样:

<meta-data android:name="com.samsung.android.sdk.multiwindow.enable" android:value="@bool/samsung_multi_window" />
于 2017-06-06T11:25:56.960 回答