当我尝试使用时ANativeActivity_showSoftInput(),它不会调出软键盘.
我尝试过使用ANativeActivity_showSoftInput(engine->app->activity, ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED)并ANativeActivity_showSoftInput(engine->app->activity, ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT)显示softinput,但也失败了.
我阅读了源代码,我发现启动nativeActivity后NativeContentView(extend View)会创建,当调用时ANativeActivity_showSoftInput,它会showSoftInput()在java端调用.我想也许软键盘没有打开.
你能帮助我吗?
谁能告诉我如何禁用和启用Enter软键盘中的键?
嗨,我需要一个软键盘只用数值0来9和Enter关键.不应该显示除了这些之外的任何东西. , ( )......

setRawInputType(Configuration.KEYBOARD_QWERTY)setRawInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED)setRawInputType(InputType.TYPE_CLASS_NUMBER)setRawInputType(InputType.TYPE_CLASS_PHONE)我总是在键盘上显示额外的字符,如:

setRawInputType(Configuration.KEYBOARD_12KEY) 显示这样的键盘:

非常感谢任何帮助.提前致谢.
注意:
android:minSdkVersion="14":ICS4.0android:targetSdkVersion="17":JB 4.2qwerty android ime android-softkeyboard android-input-method
我有一个很长的形式,当软键盘出现时,我看不到底部的editTexts
这是我的xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<TextView
android:id="@+id/register_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:text="@string/register"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/register_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/register_title"
android:layout_centerHorizontal="true"
android:text="@string/username" />
<EditText
android:id="@+id/register_edit_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/register_username"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:ems="10"
android:inputType="text" >
</EditText>
<TextView
android:id="@+id/register_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/register_edit_username"
android:layout_centerHorizontal="true"
android:text="@string/password" />
<EditText
android:id="@+id/register_edit_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/register_password"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:ems="10"
android:inputType="textPassword" >
</EditText>
<TextView
android:id="@+id/register_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/register_edit_password"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:text="@string/confirm" />
<EditText
android:id="@+id/register_edit_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/register_confirm"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:ems="10" …Run Code Online (Sandbox Code Playgroud) 我的键盘有问题.我有一个ListView编辑文本,当键盘第一次打开时,显示完成按钮而不是下一步.问题是我需要adjustResize在AndroidManifest.xml中使用,当键盘显示时列表向上移动,所以我认为这就是键盘无法正常工作的原因.但我不知道如何解决这个问题.如果有人能帮助我,我将非常感激.
谢谢
我有一个非常讨厌的问题.在Android中制作注册表单,当EditText获得焦点时,键盘出现.但它真的很慢.即使在高端设备上也需要5秒或更长时间.
我们的应用程序使用多个层次的碎片.所以我想可能计算所有这些层向上滑动(当键盘出现时)需要这么长时间.当我在清单文件中设置"adjustNothing"时,键盘会快速显示,而在另一个我们只有一层片段的活动中(这一层是注册表单),它也会很快出现.
有人有类似的问题或建议吗?(隐藏或删除注册下方的片段不是一种选择)
keyboard android soft-keyboard android-softkeyboard android-fragments
我正在尝试使用TextInputLayout创建一个BottomSheetDialogFragment.我将此BottomSheet设置为adjustResize以防止键盘覆盖TextInputLayout.问题是,我正在使用不同的Android版本获得不同的行为.
这是布局:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@android:color/darker_gray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="hint" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
这是BottomSheetDialogFragment:
public class TestFragment extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
return inflater.inflate(R.layout.fragment_test, container, true);
}
Run Code Online (Sandbox Code Playgroud)
}
这是期望的结果:
这是我在某些版本中得到的结果:
我得到了预期的结果:
没有预期的结果:
有谁知道为什么会发生这种情况或如何解决它?
提前致谢!!!
干杯.
我正在尝试创建多个IME子类型,但Android只能识别一个.
<?xml version="1.0" encoding="utf-8"?>
<input-method
xmlns:android="http://schemas.android.com/apk/res/android"
android:supportsSwitchingToNextInputMethod="true"
android:settingsActivity="com.example.softkeyboard.Settings">
<subtype android:name="@string/display_name_english_keyboard_dynamic_ime"
android:imeSubtypeLocale="en_US"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="charDataFile=strokemaps_dynamic" />
<subtype android:name="@string/display_name_english_keyboard_ime"
android:imeSubtypeLocale="en_US"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="charDataFile=strokemaps" />
</input-method>
Run Code Online (Sandbox Code Playgroud)
<resources>
<string name="app_name">KK1</string>
<string name="display_name_english_keyboard_ime">English</string>
<string name="display_name_english_keyboard_dynamic_ime">English Dynamic</string>
Run Code Online (Sandbox Code Playgroud)
@Override
public void onStartInputView(EditorInfo ei, boolean restarting) {
super.onStartInputView(ei, restarting);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
List<InputMethodInfo> imil = imm.getEnabledInputMethodList();
for (InputMethodInfo imi: imil) {
Log.e("osiv", "input method info: "+imi.toString());
}
List<InputMethodSubtype> imsl = imm.getEnabledInputMethodSubtypeList(imil.get(0), true);
for (InputMethodSubtype ims: imsl) {
Log.e("osiv", "input method subtype: "+ims.toString());
}
Run Code Online (Sandbox Code Playgroud)
列出的InputMethodInfos包含我的IME,但子类型列表只包含一个子类型.如果它是文件中唯一的子类型,则每个子类型都起作用.
Android 8.0设备不会在其语言/键盘配置选项中显示子类型,只显示IME本身,因此无法单独启用或禁用子类型. …
自从ICS以来我对软键盘的动画有问题.我使用软键盘进行数据输入活动.窗口设置为"adjustResize",以使所有视图适合软键盘上方的屏幕.由于Android 4是打开键盘的奇特动画,让我的屏幕上的视图"反弹".
看起来,好像视图是布局的,然后键盘打开,在此之后屏幕被转发,导致一种跳跃的用户体验.
有一个类似的问题:( 如何在Java中显示/隐藏软键盘而没有任何动画(例如淡入淡出)?)但是,那里的解决方案对我不起作用.(在4.2.1上测试)
我很高兴,如果有人有一些线索来实现以下解决方案之一:
干杯,弗洛里安
我正在为Android构建一个自定义软键盘,并希望添加一个布局,以包括类似于默认Android键盘(AOSP)正在做的表情符号键.我一直在搜索,但似乎大多数人都试图从图像中显示自定义表情符号.我想展示Android附带的内置图标(如下所示):

似乎我应该能够使用Unicode字符从键盘发送图像,但我的第一次尝试似乎只生成了emojis的旧版本.我如何支持手机可以处理的最新表情符号?另外,如何在键盘上显示表情符号,如上图所示?
android emoticons android-softkeyboard emoji android-input-method