自定义键盘Java-潜在的InputMethod问题
我遇到的一个问题是,在调试过程中,我创建了一个键盘,甚至成功地安装在手机上,但当我尝试选择这个特定的键盘时,应用程序停止工作。我认为这与InputMethod和AndroidManifest有关,但我不能完全确定。 有一条黄色警告告诉我,MyInputMethodService尚未包含在AndroidManifest中,但当我查看该文件时,据我所知,它位于正确的位置。代码的更多详细信息如下:自定义键盘Java-潜在的InputMethod问题,java,android,android-softkeyboard,Java,Android,Android Softkeyboard,我遇到的一个问题是,在调试过程中,我创建了一个键盘,甚至成功地安装在手机上,但当我尝试选择这个特定的键盘时,应用程序停止工作。我认为这与InputMethod和AndroidManifest有关,但我不能完全确定。 有一条黄色警告告诉我,MyInputMethodService尚未包含在AndroidManifest中,但当我查看该文件时,据我所知,它位于正确的位置。代码的更多详细信息如下: MyInputMethodService.java: 在包含的代码上方还有导入语句 公共类MyInpu
MyInputMethodService.java: 在包含的代码上方还有导入语句 公共类MyInputMethodService扩展InputMethodService实现KeyboardView.OnKeyboardActionListener{
@Override
public View onCreateInputView() {
KeyboardView keyboardView = (KeyboardView) getLayoutInflater().inflate(R.layout.keyboard_view, null);
Keyboard keyboard = new Keyboard(this, R.xml.number_pad);
keyboardView.setKeyboard(keyboard);
keyboardView.setOnKeyboardActionListener(this);
return keyboardView;
}
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.marcel54.keyboard3">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
android:fullBackupContent="true">
<activity android:name="com.marcel54.keyboard3.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:label=".MyInputMethodService"
android:name="com.marcel.keyboard.MyInputMethodService"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod"/>
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="@xml/method"/>
</service>
</application>
</manifest>
这会阻止我的键盘在安装后运行吗?这不是一个免费的编码服务,要求提供库、非现场资源和类似的东西。即使这不是问题,你也没有给出你想要的定制键盘的详细信息,如果它真的是完全定制的,你要求的太多了。但是如果您发布错误和代码,我们可以帮助您解决这些问题。为什么要使用javascript标记?